cTrader 5.4 now supports Python for building automated trading robots — no longer just C#.
Python is beginner-friendly, fast for prototyping, and backed by powerful data science libraries.
To help you get started, we’ve updated our CodePilot AI assistant to support Python fully. It can:
- Generate working Python cBots
- Convert C# to Python
- Debug and explain your scripts
- Guide you with the latest cTrader API (v5.4)
In our latest guide, we walk through everything you need to get started, from setting up your Python environment to writing your first strategy, running it in cTrader Automate, and enhancing it using our custom-built AI assistant, cTrader CodePilot.
🔗 Read the Full Guide Here
🧪 Try the AI Assistant
Example: Moving Average Crossover in Python
import cTrader
class SMAcrossover(cTrader.cBot):
def OnStart(self):
self.fast_sma = self.Indicators.SimpleMovingAverage(self.Symbol.Close, 9)
self.slow_sma = self.Indicators.SimpleMovingAverage(self.Symbol.Close, 21)
def OnBar(self):
if self.fast_sma.LastValue > self.slow_sma.LastValue:
self.ExecuteMarketOrder('buy', 1000)
elif self.fast_sma.LastValue < self.slow_sma.LastValue:
self.ExecuteMarketOrder('sell', 1000)