Reality Check: Buy Every X Bars (Point-and-Click TradeStation® Strategy)
Original Trading Strategy
Links to the section of the video titled “Using & Customizing the Built-In Strategies in Quagensia T Edition” in which the built-in “Reality Check” strategies are covered.
Peer Reviews, Modifications & Responses
Thanks for Sharing!
Trading Strategy Summary
This trading strategy acts as a quick reality check to ensure that a profitable backtest of a long-only trading strategy isn’t profitable merely because the instrument’s price chart was going up during the backtest period.
It does this by placing long-only trades using logic that clearly has no edge. Running a backtest of this strategy between two dates produces a performance profile in TradeStation®’s “Strategy Performance Report” window that can act as a benchmark with which you can compare the performance profiles of long-only trading strategies with promising backtests that you suspect may have an edge but that you want to make sure at least beat an edgeless long-only strategy on the same instrument between the same start and end dates. You can compare metrics and graphs including risk metrics, equity curves, underwater equity curves, reports that break performance metrics down by year, month, week, and day, average profit by month of the year, and more.
You can also run optimizations of this edgeless trading strategy using many combinations of its “Number of Bars for Initial Wait Period”, “Number of Bars to be Long”, and “Number of Bars to be Flat” input parameters and compare the performance profiles of its backtests with the best performing parameter sets with those of long-only trading strategies with promising optimization results.
This strategy’s logic is simple. Starting at the specified start date and time, this strategy waits to place its first trade for the number of bars specified in the “Number of Bars for Initial Wait Period” input parameter. After the wait period, this strategy repeatedly enters a long position and holds it for the number of bars specified in the “Number of Bars to be Long” input parameter then exits the long position and stays flat for the number of bars specified in the “Number of Bars to be Flat” input parameter. This continues until the specified end date and time, at which point any final long position is exited and the strategy stays flat. If the “End Date” and “End Time” is further in the future than the end date and time of the backtest, then this strategy will continue to run up to the end date and time of the backtest.
Set the start and end date input parameters to be outside the range of your backtest start and end dates if you don’t want to limit the long positions to be between two dates and times.
Set the start and end date and time input parameters to match the dates and times of the signal bar of the first entry and the signal bar of the last exit of your long-only strategy you are comparing this strategy’s performance profile against if you want to limit the long positions to be between the two dates and times that your long-only strategy had simulated trades between in the favorable backtest that you want to compare with this edgeless strategy’s backtest, to eliminate the possibility that your long-only strategy only performed better than this reality check strategy because the instrument’s price chart was going down either before your first simulated trade or after your last simulated trade and so your long-only strategy simply avoided trading during some down periods during which this reality check strategy held a long position.
If you want to enter the first long position on the earliest bar possible, change the value of the “Maximum number of bars study will reference” field in TradeStation®’s “Strategy Properties for All Strategies on this Chart” window to 0. To open the “Strategy Properties for All Strategies on this Chart” window from the TradeStation® user interface, click on the “Properties for All…” button in the “Customize Studies & Strategies” window, which is the window that shows the list of strategies being applied to the chart or about to be applied to the chart which opens whenever you add or edit a TradeStation® strategy.
When choosing start and end dates and times, remember that the signal bar is the bar before the bar that shows a trade on the chart. For instance, to exit the last long position on the last bar of the chart, the end date and time input parameters should be for the second to last bar.
Note that the smallest allowable EasyLanguage® date is 1900-01-01 and the largest allowable EasyLanguage® date is 2150-02-28, which are written like “ELDate(01, 01, 1900)” and “ELDate(02, 28, 2150)” in the input parameters properties grid in TradeStation®’s user interface.
Times are written like HHMM in the input parameters properties grid in TradeStation®’s user interface, where midnight is 0000, noon is 1200, and 11:59 PM is 2359.
Note that a bar’s date and time is its end date and time.
Copyright © 2023 Quagensia, Inc. All rights reserved.
How to Get the Quagensia Strategies
This point-and-click trading strategy is built into Quagensia T Edition (for TradeStation®).
Customize Quagensia Strategies with Your Own Ideas
Tweaking Quagensia Trading Strategies using point-and-click with the Quagensia Desktop Application is easy for non-programmers. If you get stuck you can usually find the answer you need in our online help documentation or you can ask a question in our friendly Discord community.
If you don’t want to tweak a Quagensia Trading Strategy with point-and-click to add your own proprietary trading logic, you can still download a Quagensia Trading Strategy file, open it up in the Quagensia Desktop Application, and generate its code, then backtest and optimize the trading strategy on different instruments, different bar periods (weekly bars, daily bars, hourly bars, 15-minute bars, etc.), or different bar types (time-based bars, volume-based bars, tick-based bars, etc.), and use different start and end dates.
Some tweaks you can make to the Quagensia Trading Strategies you download include:
Modify the entry & exit logic.
- Add more conditions, remove conditions, or change them by choosing from among a very large number of components, including many exotic indicators.
- Add or modify stop losses, trailing stops, and profit targets. Make them tighter, less tight, or based on an entirely different calculation.
- Add or modify time stops. For example, exit after a certain number of bars either unconditionally or only if the post-entry price action did or did not exhibit certain characteristics.
Enhance the output of the strategy to go beyond simply placing orders.
- Draw lines, shapes, and text on the chart. For instance, you can mark times or prices where each entry or exit condition of a multi-condition entry or exit was true, even if all the necessary entry or exit conditions were not true at the same time so an entry or exit did not occur.
- Write information to NinjaTrader®’s NinjaScript® Output window or TradeStation®’s EasyLanguage® Print Log window.
- Write information to a file. You can even output a report that can be opened in Microsoft Excel or consumed by another application that reads comma-delimited, semicolon-delimited, or otherwise character-delimited tabular data files.


