Python code in strategy builder — Tradetron Community
← Community

Python code in strategy builder

Strategy 10,750 views

madan

Have you used Python screen in Tradetron ? if yes, how to write code there ,should we start Python from beginning like importing numpy ,pandas … or we can directly start writing blocks ???
any refrence or sample will be really helpful…thanks in advance

Ujjwal

When you say Python code, there are actually 2 ways of looking at this.

  1. The native TT python code: This code is inserted directly in your strategy template in the python block. This is access to insert code directly into TT strategy is only with the TT quant team and is a paid service. Although it is called python, it is not the same as the regular python code. the syntax and functions are specific to what the TT engine understands and hence, this access is not public to users.
  2. The Third-party python code: As you are aware, TT based on your logic/conditions, generates corresponding signals and then the OMS takes the signals and places the orders. Third-party python code is where you keep the signal generation at your end(local to your Machine or your private VPS) and send only those signals to TT. And TT will do only the Order management.
    The signals are sent as a post request to TT. The third-party signals process is absolutely similar to integrating any third-party tool, for example, Amibroker or Tradingview
    Please follow Step 5 from the below link to generate an API link to your strategy.
    https://blog.tradetron.tech/node/32
    The only difference would be that you use the Request library in python to use a post function
    https://pypi.org/project/requests/
    https://www.w3schools.com/python/ref_requests_post.asp
    FAQ:
  3. No, your written python code cannot be directly inserted into TT.
  4. Yes you will have to get a data subscription to run python as a third-party tool locally.
  5. No, native python code insertion is not available under any subscription.
  6. Yes if you generate the signals locally you will have to keep your computer on. or use a VPS
    If you run a Third-party code, then TT does not get to know what is the logic behind signal generation, it only checks the signal values.
    Regards,
Balakrishnan

is it possible scan 200 symbol in amibroker order execution through tradetron

Tradetron Team Tradetron team

The reply above is out of date. You can now add Python to your own strategy yourself:

  1. Open the strategy in the strategy builder and use the Python Editor. Write or paste code, click Run to see output, and Validate it. Validate uses the same check that runs on save.
  2. Your code talks to the strategy through two functions, GetVar and SetVar. Your code sets a variable, and you check that variable in the Entry condition to fire the trade.
  3. If your AI is connected to Tradetron over MCP, it can write and validate the Python for you.

Guide: How to add custom Python code to Strategy | Tradetron Helpdesk

If you want it written for you, that is the paid StrategyCoded service. Python consulting is TT Quant: TT Quants — Tradetron

AmiBroker / external scanners (post #3): external signals come in through the strategy’s API webhook. The API limits are 3 calls/second, 30/minute, 250/hour (HTTP 429 beyond that). Scanning 200 symbols and sending each as a separate call will hit those limits, so batch or space the signals.

:sparkles: Answer written with AI from Tradetron docs (Oct 2026). Original replies are kept above. Spot something wrong? Reply below.