Turn Indicator Entry Filters On and Off and Don’t Plot Off Indicators (Point-and-Click TradeStation® Strategy)
Original Trading Strategy
Peer Reviews, Modifications & Responses
Thanks for Sharing!
Trading Strategy Summary
This strategy demonstrates how to add “toggleable” indicator-based entry filters to your trading strategy’s entry criteria and demonstrates how to toggle indicator visibility based on your strategy’s input parameters as well.
A toggleable entry filter is one that can be turned on or off from the TradeStation® user interface by setting input parameters to specific values that turn the toggleable entry filter on or off.
The conditions that turn a toggleable entry filter on or off and that toggle indicator visibility can be based on something as simple as whether or not a single “Boolean (True or False)” input parameter is set to True or False in the TradeStation® user interface as is demonstrated in this strategy. The entry filter toggle conditions can be complex as well, and use ANDs, ORs, and parentheses, but this is not demonstrated in this strategy.
In this strategy, when a toggleable entry filter’s input parameter is set to False in the TradeStation® user interface it will not be used as one of the entry conditions that are required to be True in order to enter a position and the indicator used by the toggleable entry filter will not be plotted on the chart upon which the strategy is applied. When its input parameter is set to True the entry filter will be used as one of this strategy’s required entry conditions and, in the case of the Simple Moving Average and Exponential Moving Average but not the oscillators, the indicator used by the toggleable entry filter will be plotted on the chart.
The way that each entry filter was turned into a “toggleable entry filter” can be seen in this strategy’s “When Bar Updates” section. Note how each toggleable entry filter is “ORed” together with its specific toggle condition that turns it on or off and that these two conditions are inside of parentheses so that they are determined to be True or False as a group. The condition above each OR checks if the entry filter’s toggle is on or off. If the entry filter’s toggle condition is off then the ORed conditions in the parentheses are evaluated as True regardless of whether the specific indicator-based entry filter is True or False on that bar, tick, or price change and won’t filter out entry signals on that bar, tick, or price change. If the entry filter’s toggle condition is on then the specific indicator-based entry filter must be True for the ORed conditions in the parentheses to be evaluated as True for the entry signal to not be filtered out on that bar, tick, or price change.
The way that the indicators are plotted or not plotted based on if their respective entry filter toggles are turned on or off is by creating a condition in the plotting settings for that indicator’s internal variable that must be True for the indicator to be plotted. You can use this technique to conditionally plot indicators, Editable Time Series, and horizontal lines that you define as internal variables in your own strategy’s internal variables section by checking the “Plot This” checkbox of the internal variable, clicking the link that reads something like “Set Conditions That If False Will Cause Plot to Not Be Plotted” and then building a condition or set of conditions in the field that appears.
Note that while this strategy uses toggleable entry filters, you can create “toggleable exit filters” using the same approach.
Note that the oscillators used by this strategy will not be plotted on the chart even if their toggle conditions are set to True due to the reason discussed in the Quagensia T Edition onboarding card that describes why it is usually the best approach to add TradeStation® indicators manually from within TradeStation® rather than plotting them automatically from your Quagensia T Edition Strategy. Here is the relevant portion of that onboarding card (whose text may change in the future) that describes the problem with plotting oscillators automatically from your Quagensia T Edition Strategies:
“Many indicators should be plotted on a separate panel than the panel on which prices are displayed, because many indicators have plots whose numeric values are much lower or much higher than the prices of the instrument whose prices are used by the indicator to calculate its values. There is no way (of which we are aware) to automatically plot an indicator from within a TradeStation® EasyLanguage® strategy on a different panel than the panel on which the prices are displayed. By default, TradeStation® charts automatically select the minimum and maximum values of the Y-Axis of a price chart to fit the prices nicely without much wasted space at the top or bottom of the chart. If you automatically plot an indicator from within your strategy and your indicator’s values are much lower or higher than the prices of the instrument on which you are backtesting your strategy, it will not be visible on the chart. Even if you change the minimum or maximum value of the chart’s Y-Axis to include the numerical values of your indicator, both the prices and the indicator plot will be hard to see since both will be vertically compressed with most likely a large amount of wasted vertical space between them. When you add an indicator manually from within TradeStation®, it can be plotted on a different panel than prices, which solves this issue.”
Copyright © 2024 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.


