Long Strategy Template (Basic – 3 Params, Trailing Stop & Profit Target) (Point-and-Click NinjaTrader® Strategy)
Original Trading Strategy
Peer Reviews, Modifications & Responses
Thanks for Sharing!
Trading Strategy Summary
This is the basic long strategy template for free trial users with a trailing stop and profit target that you can make a copy of and make changes to in order to create your own strategy without having to start from scratch with an entirely new, empty Quagensia N Edition Strategy.
You can easily customize its long entry criteria, long exit criteria, and the input parameters of its trailing stop and profit target without code, and use the following pre-built strategy logic as-is:
1. The strategy’s custom exit criteria can be turned off if you want your strategy’s positions to only be exited by a trailing stop or profit target, not based on additional custom exit criteria. Since NinjaTrader® allows you to optimize a strategy over Boolean (True or False) input parameters, this allows you to optimize your strategy based on the inclusion or exclusion of an exit based on custom exit criteria.
2. The strategy has a trailing stop and profit target built-in, and they can be turned off independently of each other. Since NinjaTrader® allows you to optimize a strategy over Boolean (True or False) input parameters, this allows you to optimize your strategy based on the inclusion or exclusion of a trailing stop and/or profit target.
3. The strategy prints information to the NinjaScript® Output window and sets the background color of all chart panels to light blue or pink when custom entry or exit criteria are True.
After you use the built-in long strategy templates as starting points for your own long strategies for a bit, we recommend that you create your own long strategy templates to be more ideal for your specific needs than this strategy template is. You can start with a copy of this strategy template (or the more feature-rich paid version of this strategy template, which is denoted by the suffix “Paid”) and add in your proprietary logic that is common to many of your long strategies to create the perfect long strategy templates for you, save them to your “My Algos” folder, and make copies of your own proprietary strategy templates as highly customized starting points for your long strategies. You may also wish to remove all the “Comment in Code” textboxes that contain commentary meant mainly for new users once you’ve learned the information so you won’t have to keep scrolling past them.
Users with a valid paid license can use the more feature-rich paid version of this long strategy template to benefit from the additional pre-built strategy logic:
1. The paid version allows you to use a stop loss or parabolic trailing stop also, instead of only being able to use a trailing stop. You can choose which one to use from a drop-down list in the NinjaTrader® user interface. Since NinjaTrader® allows you to optimize a strategy over drop-down list input parameters, this allows you to optimize your strategy based on the type of protective stop used. The paid version also allows you to turn off the protective stop altogether, which allows you to optimize it over the inclusion or exclusion of either a stop loss, trailing stop, or parabolic trailing stop.
2. All of the optimizable input parameters of the paid version’s profit target, stop loss, trailing stop, and parabolic trailing stop have corresponding input parameters defined in the strategy’s “Input Parameters” section that can be changed and optimized over from the NinjaTrader® user interface.
3. All five indicator plot styling fields of both the Fast Moving Average and the Slow Moving Average of the paid version of this strategy have corresponding input parameters defined in the strategy’s “Input Parameters” section that can be changed from the NinjaTrader® user interface. This includes an input parameter of Type “Color” for “Plot Color” that appears as a color picker in the NinjaTrader® user interface, input parameters of “List of Choices” Types “Plot Style” and “Line Style” (for the plot’s “Dash Style” field) that appear as drop-down lists in the NinjaTrader® user interface, and numeric input parameters for the plot’s Opacity (0-100) and Line Width fields.
4. The plots of both the Fast Moving Average and the Slow Moving Average of the paid version of this strategy can be hidden or shown independently of each other by unchecking a checkbox in the NinjaTrader® user interface.
5. The “Period” input parameter of the Fast Moving Average and the Slow Moving Average can be changed and optimized over in the NinjaTrader® user interface.
Copyright © 2024 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.

