Add custom Python code to a strategy — Tradetron Community
← Help Center

Add custom Python code to a strategy

Create a strategy 2 views

Yes, you can add Python to a strategy yourself.

In the strategy builder

  1. Open your strategy in the Advanced Strategy Builder.
  2. Open the Python Editor.
  3. Write or paste your code.
  4. Click Run to see the output, and Validate to check it. Code that passes validation will save.

Over MCP

If you have connected your AI assistant to Tradetron over MCP, it can write and validate Python in your strategy for you.

How your code talks to the strategy

Use the GetVar and SetVar functions to read and write variables. Your code sets a variable, then you use that variable in the entry condition. When the condition is met, the trade is placed.

Need help?

:sparkles: Edited with AI from the original Tradetron article, checked against current docs (Oct 2026). Spot something wrong? Tell us in the Community.

Still stuck? Ask the community

Tradetron अब हिन्दी में भी उपलब्ध है हिन्दी में देखें Continue in English