The idea: a seasonality rule in EasyLanguage
This page shows, with a real example, how a programming language like EasyLanguage can be integrated with AI agents without leaving the platform the trader already knows. The topic is a simple seasonality idea written in EasyLanguage and the way an AI agent takes it to a basket of stocks, validates it and returns it in EasyLanguage.
What TradeStation shows and what is missing
Equity line and Optimization Report are the output the trader knows. The images are illustrative, in the TradeStation style, with numbers computed in Python on DIA.
The TradeStation report describes the strategy in absolute terms. Two things are missing: the comparison with the benchmark, i.e. buy & hold, and the robustness analysis, i.e. how much the result depends on the parameters and on the period.
Single Python backtest against the benchmark
A single backtest written by an agent in Python: same rule as the EasyLanguage one, compared with buy & hold on DIA.
The strategy is invested less than half of the time. The Net Profit of buy & hold is higher; the Sharpe and the drawdown of the strategy are better.
Robustness analysis: the grid search
The grid search runs 900 combinations in a few seconds. The Sharpe is read by entry day (DayX) and by holding days (HoldDays), always against buy & hold (0.66).
Choosing the strategy and returning to EasyLanguage
This is where the trader decides. The grid search numbers guide the choice, but the rule to take to market is chosen by the person who trades.
The cycle
- A simple rule written in EasyLanguage can be taken by the agent to a basket and validated.
- The TradeStation report is not enough: the comparison with buy & hold and the robustness analysis are needed.
- On DIA monthly seasonality no day beats buy & hold in Sharpe, but the start and end of the month are the best zones.
- The agent speeds up the work. The decision stays with the trader.
For more information: info@tradingalgo.it
Content for research and educational purposes. It does not constitute advice or a solicitation to invest. Backtest results do not guarantee future results. DIA data 2010-2025, 100 shares, costs 0.