Reality Check: Sell Short and Hold (Point-and-Click NinjaTrader® Strategy)
Original Trading Strategy
Links to the section of the video titled “Using & Customizing the Built-In Strategies in Quagensia N 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 short-only trading strategy isn’t profitable merely because the instrument’s price chart was going down during the backtest period.
The main value of this strategy is not that it calculates a single profit metric for shorting a single instrument and holding the short position between two dates, because a single profit metric for a single instrument can be quickly calculated manually using a calculator and a NinjaTrader® chart. Instead, the main value of this strategy is two-fold:
1. When you run a backtest of this strategy between two dates and view the results in NinjaTrader®’s Strategy Analyzer, you get the entire performance profile of selling short and holding an instrument, not just a single performance metric. You can then compare the entire performance profile of your strategy with that of shorting an instrument and holding the short position between two dates by viewing the performance profile of each strategy in the Strategy Analyzer.
2. While it is easy to calculate a single profit metric for shorting a single instrument and holding the short position between two dates, it becomes time-prohibitive to do this manually for each of a large basket of instruments, like all the stocks in the S&P 500 index. A quick backtest of this strategy on a basket of instruments removes the need to do any manual calculations on each of the instruments in the basket of instruments, plus you get all the benefits of the Strategy Analyzer’s performance profile for each of the instruments in your basket as previously described.
This trading strategy enters a short position on the bar directly after the bar whose date and time is greater than or equal to the “Start Date and Time” input parameter and holds the position until the backtest comes across a bar whose date and time is greater than or equal to the “End Date and Time” input parameter if such a bar is encountered, or if no such bar is encountered because the “End Date and Time” is further in the future than the end date and time of the backtest, then it will exit the position on the close of the last bar in the backtest period.
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 short position 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 entry and the signal bar of the exit if you want to limit the short position to be between the two dates and times that your short-only strategy had simulated trades between in the favorable backtest that you want to compare against selling short and holding the same instrument, to eliminate the possibility that your short-only strategy only performed better than this reality check strategy because the instrument’s price chart was going up either before your first simulated trade or after your last simulated trade and so your short-only strategy simply avoided trading during some up periods during which this reality check strategy held a short position.
When choosing start and end dates, remember that the signal bar is the bar before the bar that shows a trade on the chart. For instance, to exit the short position on the open of the last bar of the chart, the end date and time input parameter should be for the second to last bar.
When this strategy is backtested in the Strategy Analyzer, it prints out open, high, low, and close price info for the entry signal bar and the bar after it as well as the exit signal bar and the bar after it, so long as each of the four bars are complete, i.e. not partially built. Therefore if the exit signal bar is the second to last bar on the chart and the last bar on the chart is partially built, open, high, low, and close price info will not be printed for the bar after the exit signal bar since it is not yet complete.
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 N Edition (for NinjaTrader®).
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.


