How EasyLanguage Makes Trading System “What-If” Testing Faster
One of the biggest advantages of systematic trading is the ability to take a market idea, turn it into a rule, and test it objectively.
In this video, I use our V Reversal trading system to demonstrate how quickly simple “what-if” ideas can be scripted and tested using TradeStation EasyLanguage.
These are the kinds of questions that come up regularly from traders, subscribers, and brokers:
- What if we stop taking trades after the first winner of the day?
- What if we do not take a second trade in the same direction as the first?
- Would the drawdown improve?
- Would average trade profit improve?
- Would we give up too much total net profit?
Rather than debating those questions theoretically, we can code the rule, backtest it, and compare the results.
V Reversal Base Strategy Results
The starting point for this test is the base version of V Reversal using the accelerated trailing stop-loss configuration.
The backtest shown in the video begins in 2020 and includes approximately $25 round-turn commission and transaction costs per contract.
| Metric | Base V Reversal |
|---|---|
| Total Net Profit | $254,905 |
| Maximum Drawdown | Approximately $24,000–$25,000 |
| Average Trade Profit | Approximately $130 |
| Net Profit / Maximum Drawdown | Approximately 10.5x |
Two of the first metrics I look at when evaluating a trading system are:
- Net profit as a percentage of maximum drawdown
- Average trade profit
Total net profit matters, but it does not tell the entire story. I also want to know how much drawdown was required to produce that return and how much edge exists on the average individual trade after costs.
Long Trades Versus Short Trades
Another useful part of the analysis is separating long and short trades.
In this V Reversal test, the long trades produced stronger results than the short trades. However, the maximum drawdowns for the long-only and short-only components were both approximately $25,000.
Interestingly, when the long and short trades are combined into the complete strategy, the maximum drawdown is slightly lower at approximately $24,000.
This illustrates an important portfolio concept even within a single trading system: different trade directions can offset one another at different times.
What If We Do Not Take the Same Trade Direction Twice?
The first variation addresses a very simple question:
What if the strategy is not allowed to take a second trade in the same direction as the first trade of the day?
For example, suppose the first trade of the day is long.
Under this new rule, the strategy could still take another trade later in the session, but that second trade could only be short.
It could not take another long trade.
There have certainly been many historical sessions where two consecutive long trades worked well. The market might produce an initial long setup, pull back, and then create a second profitable long setup later in the day.
But instead of assuming those repeat trades are beneficial, we can test the rule.
Results of the Same-Direction Restriction
After adding the rule, the results changed to approximately:
- Total Net Profit: $219,000 versus approximately $254,000 in the base strategy
- Maximum Drawdown: approximately $28,000 versus approximately $24,000
- Average Trade Profit: roughly unchanged
In this case, the modification did not improve the primary risk-adjusted metrics.
Total net profit declined, maximum drawdown increased, and average trade profit remained relatively similar.
The equity curve also did not change dramatically.
That does not necessarily mean the rule has no value. It means that, historically, this particular restriction did not provide an obvious improvement over the existing V Reversal setup.
Why This Type of Testing Matters
This is where systematic trading research becomes valuable.
A trading rule can sound completely reasonable in conversation:
“If the first long trade fails, maybe we should not take another long trade that day.”
That logic may feel intuitive.
But intuitive does not necessarily mean profitable.
The only way to know how a rule would have affected historical performance is to test it.
With EasyLanguage, relatively simple hypotheses like this can often be coded and evaluated very quickly.
What If We Stop Trading After the First Winner?
The second variation is even more straightforward.
What if the strategy stops trading for the day after the first profitable trade?
The theory is simple.
Once the strategy has produced a winning trade, we lock in the successful session and avoid giving some or all of those profits back on a later setup.
Again, this is not automatically better.
A second trade could produce another significant winner. By stopping after the first profitable trade, we may reduce losses, but we may also eliminate valuable follow-up trades.
Results of Stopping After the First Winner
The modified strategy produced approximately:
- Net Profit / Maximum Drawdown: approximately 10.03x versus approximately 10.51x in the base version
- Maximum Drawdown: roughly $3,000 lower
- Total Net Profit: approximately $30,000 lower
- Average Trade Profit: approximately $138 versus $130 in the base version
This result is more interesting.
The strategy traded less frequently, maximum drawdown improved, and average trade profit increased.
However, total net profit declined enough that the overall net-profit-to-drawdown ratio was slightly worse.
So once again, the answer is not simply that one version is universally better.
It becomes a question of priorities.
A trader who values fewer trades and a slightly higher average trade may prefer one version, while a trader focused on maximizing total historical return may prefer the original.
EasyLanguage Makes the Test Simple
One of the reasons I continue to use TradeStation for trading system research is the speed at which ideas like this can be tested.
For the “stop after the first winner” variation, TradeStation already includes a built-in EasyLanguage function that allows the strategy to determine whether a profitable trade has already occurred during the current session.
That means the rule can be added directly to the existing long and short entry conditions without rebuilding the entire strategy.
The objective is not to spend the entire day writing infrastructure code.
The objective is to move quickly from:
Market Idea → Trading Rule → Backtest → Results → Next Idea
That research cycle is extremely important when developing algorithmic trading systems.
Focus on Market Ideas, Not Just Coding
There are many powerful programming languages and development environments available to quantitative traders.
Python, C#, C++, MATLAB, and other tools all have important applications.
But for rapid trading strategy research, there is value in using a language designed specifically around trading.
If I have a new hypothesis about V Reversal, I want to be able to test it quickly, determine whether the historical results improve, and then either investigate the idea further or move on.
The coding is the mechanism.
The market hypothesis is the actual research.
The Larger Lesson: Test the “What If?”
Trading system development involves constantly asking questions.
- What if we eliminate this trade?
- What if we change the session?
- What if we separate long and short trades?
- What if we stop after a winner?
- What if we restrict repeat entries?
- What if we change the exit logic?
But every additional rule also creates another opportunity to overfit historical data.
The goal is not to keep adding rules until the historical equity curve looks perfect.
The goal is to ask economically and behaviorally reasonable questions, test them objectively, and determine whether the change produces a meaningful improvement that may have a logical basis for continuing into future markets.
Sometimes the answer is yes.
Often the answer is no.
Both answers are useful.
Watch the Full Video
In the video, I walk through the actual V Reversal strategy performance, compare the different variations, review the equity curves, and show how the EasyLanguage rules can be incorporated into an existing strategy.
Watch the video on the Capstone Trading Systems YouTube channel and subscribe for additional algorithmic trading research, strategy development, coding examples, and real-world trading system performance analysis.
At Capstone Trading Systems, we share both the winning streaks and the losing streaks as we continue researching systematic approaches to the futures markets.
Visit Capstone Trading Systems →
Risk Disclosure: Futures trading involves substantial risk and is not suitable for every investor. Past performance is not necessarily indicative of future results. Hypothetical and backtested performance results have inherent limitations and do not represent actual trading. Transaction costs, slippage, liquidity, market conditions, and other factors can materially affect actual results.