Summary
The Strategy is a Premium mechanical strategy for the NinjaTrader 8 platform The strategy can be used to pass propfirms evaluation challenges
We highly recommend joining our discord community by following this invite link
Index
Prequisites
To properly use this strategy you should have available the following prequisites
- NinjaTrader 8. with any license type . OrderFlow is not needed to run this strategyClick here to download
- automated-trading.ch Account with Premium Subscription
Important Disclaimer
We strongly recommend that you never run your algorithmic trading systems on your hard-earned real money. You should always minimize your risk and run your strategies on trader funding programs so that the maximum amount your risk to lose is the monthly subscription fee you pay those programs.
Here are the trader funding programs that we recommend using, and that we use to run the XABCD Harmonics strategy on:
Entry Setup Criteria
This strategy is based on entering trades following XABCD harmonics pattern. Those patterns are defined by swing points generally named X,A,B,C and D. These points define Legs on which we can calulate ratios.
For example the AB/XA ratio is calculated by dividing the AB leg retracement by the XA price initial move. When all of the legs respect a specific ratio rule set, those patterns are recognized.
If you want to learn more about the XABCD Harmonics patterns, please have a look at the XABCD Harmonics indicator page
Chart Examples
These examples were handpicked to show the best case scenarios where the recognition engine detects valid patterns. In the cas of real-time trading, the patterns detected will not always lead to a winning trade, this is the reality of trading where you should aim for a long term profitablity. These examples are all taken on the MES instrument on the 1 Minute timeframe
MES 1 Minute timeframe - Bullish Butterfly
In this example, we are on MES 1 Minute Timeframe. The strategy recognized a bullish butterfly pattern. One bar after the pattern was detected, the strategy has entered a long trade targeting 1.5 the stop target which is the D swing price of the pattern leading into a win trade.
Notice that in this exaxmple, the strategy is set to enter immediately on bar close. Which means no confirmation bar is waited for. See below for examples with waiting for bar confirmation.
MES 1 Minute timeframe - Bearish Overlapping Butterfly
In this example, you can see a particular aspect of the strategy that occurs very often which is overlapping patterns. You can see on the screenshot above two butterfly patterns detected on top of each other. In this case the strategy will enter the first valid pattern which is in this example the first butterfly pattern.
MES 1 Minute timeframe - Bullish Gartley Following the trend
Gartley XABCD Harmonic pattern is a trend following pattern. In this example you can see two consecutive trades taken by two Gartley patterns with the trend.
MES 1 Minute timeframe - Loss avoided with Trend Filter
This example illustrates a cas where the trend filter (explained below) is used to avoid entering trades counter the trend. The Trend Filter is a filter based on analyzing swing points as shown on the image above. The two arrows in red mark the bullish trend direction defined by swing points going upward. This gives the strategy a filter to only enter long trades in this case, that is why no bearish trades were open on the first Gartley Pattern. On the second arrow the same thing is observed. The two swing points circled shows an upward trend that made the strategy decide not to enter short and made us avoid two losses.
Features
The XABCD Harmonics strategy has a set of unique features:
- Robust In-house implementation of XABCD Harmonics pattern recognition algorithm
- No pending orders are placed: only market orders which produces no cases of rejected orders or partial fills
- Full-auto strategy that can be scaled into multiple unlimited instances with only one license
- Precise backtesting capabilities following NinjaTrader official best practices to obtain precise entry/exit backtesting on tick level intrabar granularity
- Robust In-house Order management library. Resistant to connection loss and works seamlessly on Rithmic accounts or Tradovate accounts
- On chart command buttons to manually manage the positions if manual intervention is needed
- Very lighweight strategy that can be run on multiple instances even on low power VPS
Here I further explain some of the features of the strategy in more details
Dynamic Quantity and Risk Management
As all our strategies, this strategy implements two methods to set quantity for open positions.
- Fixed Quantity: This method will use the same quantity value for each position. If the stoploss is variable between positions (by using a dynamic stop loss value), The win/loss produced by this method will be also variable between positions
- Dynamic Risk Adjusted Quantity: This method will calculate quantity of each position based on multiple factors:
- The stoploss of the position
- The maximum risk (in $ currency value) allowed for a position to take
- The maximum quantity allowed for a position to take
Position Management
As all our strategies, this strategy implements mutiple position management methods :
- ATM Strategy:If you wish to delegate the position management to your own ATM strategy, this is possible by selecting an ATM strategy of your choice from the drop down box
- Classic Trailing Stop:This method will trail the stop loss based on a configurable trigger and amount
Apart from those position management methods, the strategy allows to set the stop loss based on multiple strategies and to set the take profit based on a ratio based method. Check the parameters section for a detailed explanation
Account Management
The strategy implements daily stop-trading triggers based on the Net winning position count, the Net losing position count or when a target realized Net profit is reached. or when a target net loss is reached.
Parameters
We try to keep the parameters to minimum. We only left the most important parameters to be set
General | |
Execute Historical Trades | This parameter is very important and should be used carefully. This parameter should be set to true (checked) whenever the strategy runs in Historical, Backtest, or Optimization modes. When running the strategy in Live Real-Time mode this parameter should be set to false (unchecked). |
Daily TakeProfit Target | The strategy will stop when the daily TakeProfit amount is reached after a position is closed. When set to 0, this parameter is ignored |
Daily StopLoss Limit | The strategy will stop when the daily StopLoss amount is reached after a position is closed. The value of this parameter is positive. For example if the value is set to 300, the strategy will stop when the Realized PnL is lower or equal to -300$. When set to 0, this parameter is ignored |
Stop @ Winning Count | This will make the strategy stop trading if the net count of winning trades for the day is equal to the value of this parameter. This parameter is ignored if equal to 0 |
Stop @ Losing Count | This will make the strategy stop trading if the net count of losing trades for the day is equal to the value of this parameter. This parameter is ignored if equal to 0 |
Execute on Different Instrument | The parameter will enable executing trades on another instrument than the one on the active chart. This can be useful if you sant to run the strategy logic on Minis and execute on Micros to better manage the risk by opening the trades on Micros. Notice that if you enable this parameter all the risk calculation done by the strategy will be made on the execution instrument. And notice also that since the instrument on the chart is not the execution instrument you will not see order execution history on the chart. |
Execution Instrument | The parameter will let you chose from a list of Micros available on your NinjaTrader connection, the instrument on which trades will be executed. notice that historical trades and live trades will Not be displayed on the Chart in this case. |
Order Label | The parameter will let you set a Label that will be suffixed to all positions sent to the broker. This is useful in case you want the positions sent to the broker to have a specific value to differentiate them from positions of other people using the same strategy |
Enable/Disable Trading Days |
This parameter allows to restrict trading on certain week days.
|
XABCD Harmonics | |
Swing Period | Swings are higher lows,higher highs, lower highs and lower lows. After each price bar close, a swing can be detected. But just after that, the next bar can cancel the swing at the previous bar by creating a new swing of the same type. Or this can happen on the second bar, or the third, etc... The swing period sets how many bars is enough to seperate two swings of the same type. The more you increase this parameter, the more you decrease the number of swings overall. The more you decrease this parameter, the more you increase the number of overall swings. This parameter has a big impact on the quality of harmonic XABCD patterns. More swings means more patterns and vice versa |
Show Price Swings | This parameter will enable/disable drawing a mark below/above swing price points. This is useful if you want to see how market structure is analyzed since those swing points are the building blocks of the XABCD pattern recognition algorithm. |
Swing Bullish Color | This sets the color brush of the low swing points |
Swing Bearish Color | This sets the color brush of the high swing points |
Swing Opacity (1-100) | This sets the opacity of the swing points drawing. The value of 0 is trasparent, and the value of 100 is full opaque |
Enable Gartley | Enable/Disable trading Gartley patterns |
Gartley Ratio Tolerance % | This sets the tolerance in percentage on the Legs ratio rules. When this value is set to 10 for example, it means that the recognition algorithm will apply a 10% tolerance on the ratio set for legs, if for example a leg ratio should be around 0.368, by applying 10% tolerance, the actual leg ratio can be between (0.368 + 10%) and (0.368 - 10%) |
Enable Bat | Enable/Disable trading Bat patterns |
Bat Ratio Tolerance % | This sets the tolerance in percentage on the Legs ratio rules. When this value is set to 10 for example, it means that the recognition algorithm will apply a 10% tolerance on the ratio set for legs, if for example a leg ratio should be around 0.368, by applying 10% tolerance, the actual leg ratio can be between (0.368 + 10%) and (0.368 - 10%) |
Enable Crab | Enable/Disable trading Crab patterns |
Crab Ratio Tolerance % | This sets the tolerance in percentage on the Legs ratio rules. When this value is set to 10 for example, it means that the recognition algorithm will apply a 10% tolerance on the ratio set for legs, if for example a leg ratio should be around 0.368, by applying 10% tolerance, the actual leg ratio can be between (0.368 + 10%) and (0.368 - 10%) |
Enable Butterfly | Enable/Disable trading Butterfly patterns |
Butterfly Ratio Tolerance % | This sets the tolerance in percentage on the Legs ratio rules. When this value is set to 10 for example, it means that the recognition algorithm will apply a 10% tolerance on the ratio set for legs, if for example a leg ratio should be around 0.368, by applying 10% tolerance, the actual leg ratio can be between (0.368 + 10%) and (0.368 - 10%) |
Enable Shark | Enable/Disable trading Shark patterns |
Shark Ratio Tolerance % | This sets the tolerance in percentage on the Legs ratio rules. When this value is set to 10 for example, it means that the recognition algorithm will apply a 10% tolerance on the ratio set for legs, if for example a leg ratio should be around 0.368, by applying 10% tolerance, the actual leg ratio can be between (0.368 + 10%) and (0.368 - 10%) |
Enable Cypher | Enable/Disable trading Cypher patterns |
Cypher Ratio Tolerance % | This sets the tolerance in percentage on the Legs ratio rules. When this value is set to 10 for example, it means that the recognition algorithm will apply a 10% tolerance on the ratio set for legs, if for example a leg ratio should be around 0.368, by applying 10% tolerance, the actual leg ratio can be between (0.368 + 10%) and (0.368 - 10%) |
Entry Setup | |
Time Zone |
This parameter sets the time zone to be used for setting the Trade Time parameter below. Since futures markets are open and closed based on US market time zone which is EST (US Eastern, New York), this parameter allows you to specifiy trade time interval on another timezone which is your local machine timezone
|
Trade Time | This parameter is very important and can be delicate in some cases. This parameter is used to specify the time intervals in which the strategy is allowed to place trades. Here are some examples for more clarifications:
|
Quantity Strategy |
This parameter sets how the quantity should be set for a Trade
|
Max Qty | This parameter sets the maximum allowed quantity when the Risk Adjusted method is selected. This option is very useful since some propfirms has order quantity limits that can cause the account to be invalidated |
Entry Mode |
This parameter sets the trigger to enter a trade after an XABCD pattern is recognized and validated
|
SuperTrend Entry Filter | This parameter will enable/disable using the SuperTrend indicator as an entry filter. When this is enabled, Long trades are allowed to enter only when the SuperTrend is in bullish mode. Inversly, it allows short trades to enter only when the SuperTrend indicator is in bearish mode |
Swing Trend Entry Filter | This parameter will enable/disable filtering entries based on the previous price swing prior to each XABCD pattern. This filter aims to analyze the position of the first swing point of the XABCD pattern compared to its previous price swing point. In the context of a bullish entry, this filter requires the previous swing point to be below the XABCD, which supposes the continuation of a bullish trend. Inversly, for a bearish entry, this filter requires the previous swing point to be above the XABCD pattern |
Order Qty | This parameter is only used if the Quantity Strategy is set to Fixed. This parameter sets a fixed quantity of each trade. |
Order Management | |
Order Management Strategy |
|
ATM Strategy Template Name |
This parameter is available when the ATM Strategy order management method is selected. This parameter specifies which ATM strategy to use. As in the image example above, the value of this parameter should be the template name of your custom ATM strategy. In the example is should be equal to template1 off course you can chose another name, but the most important thing is that the parameter value should correspond to an existing "ATM strategy template" otherwise no position will be opened |
Scale out % Qty at % Target | This option will enable a scaling out mechanism that consists in closing a percentage of the position quantity when the price hits a certain percentage of the the profit target. The value calculated is rounded to the lower value if the percentage value calculated is fractional. For example, if the position is a 5 quantity positions, and the quantity percentage of this parameter is set to 50%, the quantity closed will be 2 (lower end of 2.5) |
Scale out at % Target | This parameter sets the percentage of the profit target that will trigger the scaling out mechanism |
Scale out % Qty | This parameter sets the percentage of the quantity that will be closed during the scaling out mechanism |
Enable Price Breakeven | This parameter will enable/disable breakeven mechanism based on price |
Breakeven Price Strategy | This parameter sets how the price based breakeven should be calculated
|
Breakeven Price Trigger | This parameter is available if Price based Breakeven is enabled This parameter sets the trigger value that needs to be reached in order to set the stoploss of the current position to breakeven |
StopLoss Strategy |
|
TakeProfit Strategy |
|
Target Risk Per Trade ($) | This sets the max risk in dollars for one position.
|
Max Allowed Risk Per ($) |
|
Stop Loss Points | This parameter is available if the Stop Loss strategy is set to Points |
Stoploss offset Points | This parameter will add an offset of points to the calculated stoploss level. This offset will be used when calculating Risk per trade |
Take Profit Points | This parameter is available if the Take Profit strategy is set to Points |
Take Profit Currency | This sets the take profit in dollars for the open position. If you use the Fixed Currency Value as a take profit strategy, the value of this parameter will be used. If not, make sure to set this parameter to a high value to not interfer with other ratio based strategies |
Trailing Stop Parameters | |
Trailing Stop Strategy | When the Classic Trail Stop method is selected, this parameter let you chose on which basis the trailing will be calculated
|
Trailing Stop Trigger | When the Classic Trail Stop method is selected, this parameter sets the trigger (in Points or in Ratio) |
Trail Amount | When the Classic Trail Stop method is selected, this parameter sets the amount (in Points or in Ratio) to be trailed when the trigger is hit |
Super Trend | |
This section is visible only when the SuperTrend Entry Filter parameter is enabled | |
SuperTrend Mode |
|
Period | This sets the supertrend period |
Multiplier | This sets the Supertrend multiplier. The bigger this parameter the wider the superstrend bands |
Moving Avg. Type | This selectes the Moving Average type for Supertrend |
Smooth | This sets the smoothing period of the supertrend |
Command Buttons | |
The strategy allows to manually execute some commands in case you want to manually intervene. The commands buttons are added to the Chart Trader panel, make sure to show it on your active chart | |
![]() | |
Arm/Disarm Buttons | The Arm Long/Disabled Long and Arm Short/Disabled Short buttons can manually activate or deactivate entering trades long or short. By default those two toggle buttons are enabled meaning the strategy is armed to enter both long and short trades. Toggling the button to the disable will restrain the strategy to enter a trade in the disabled direction. This can be useful if you have a directional bias or conviction about the direction of the market |
Close Position Button | The Close position button will immediately flatten the position on the active instrument on the active Chart. This can be useful if you want to exit a trade without having to affect the strategy or restart it. After closing the position, the strategy will continue to function normally and look for new trades to take |
Increase Qty Button | The increase Qty button allows to increase the quantity of the current active position by +1 contract |
Decrease Qty Button | The decrease Qty button allows to decrease the quantity of the current active position by -1 contract |
Set Breakeven Button | The button will set the stoploss of the open position to breakeven level if the current stoploss price is lower than breakeven price for long entries and higher than breakeven price for bearish entries. |
Download & Installation Instructions
At automated-trading.ch you can chose to either purchase monthly subscription to use our premium products, or use our Free products without a premium subscription
In both cases, you need to create an account so you can get a License that you can use for both Premium and Free products
To obtain the license simply Signup and then get your license on the billing page
This XABCD Harmonics strategy is a premium strategy. It can be run on Backtest, Playback and Optimization modes for Free. Whereas an active subscription is required to run it on Live mode.
To download and install the strategy follow the instructions below
- Click on the below download button to download the XABCD Harmonics Strategy file
- Import the downloaded .zip file into NinjaTrader using the import NinjaScript menu item
- Next, open a new chart window while making sure the Tick Replay tickbox is checked
- If you don't see the Tick Replay check box, go to Tools->Options->Market Data and enable Show Tick Replay
- After installing the strategy and opening a new Chart window you should add the strategy to the chart. Right-Click on the chart and Click on
the the "Strategies" Context menu entry. Or you can Ctrl+S on the Chart to open the "Add New Strategy" Dialog window
Click to enlarge - Make sure to check the Enabled check box
- After adding the strategy to the chart, the strategy will be run on Historical data loaded in the chart.
- When the Histocial data run is done, the strategy will switch to Real-Time mode and will add the license panel text box on the "Chart Trader Panel"
- Make sure to display the Chart Trader panel on your active NinjaTrader Chart
- Copy/Paste your license in the text box as shown in the image below. Your license can be found on the billing main page. Make sure to create an account or login first
- Click on the Check License Button
- At this step the strategy will check the License and activate/deactivate trading according to your subscription state
- If you have an active subscription, will see the "Check License" button turned to green, and the next verification date next to your email. License check is only required once. Until the next verification date.
- At this stage, the strategy is Ready. If your license is valid, the strategy will continue running on live mode
- If you chose to not subscribe yet, and want to test the strategy beforehand, you can run it on Playback and Historical modes






Frequently Asked Questions
General
Using a VPS is good but not imperative. I run this strategy on a ~$6 VPS Windows instance on Hetzner. Check out our resources page to get a discount through our affiliate LINK
Yes! You can run multiple instances of this strategy on the same account but each instance should be run on a unique instrument
You can't run multiple instances on the same account on the same instrument because as you know NinjaTrader will aggregate orders in one position per instrument per account
Yes! you can use a copier, but a better solution would be to run multiple instances of the strategy. The purchased license allows you to run unlimited instances on multiple machines
Yes! The strategy is designed for that exact purpose. It will work seamlessly on Rithmic, NinjaTrader brokerage, Tradovate or any other provider connected to your NinjaTrader platform
I designed this strategy to be full-automatic strategy. Yet, it can be used as a semi-auto strategy to enter trades and then let you manage those trades manually using its command buttons
You should consider full auto-trading over manual trading for many reasons:
- Trading 24/7: Automated trading strategies don't need to go to the bathroom not it need to take a break
- Better execution, faster and more precise
- Eliminate psychology and sentiments
- Can be scaled to dozens if not hundreds of instances
- Automated trading can generate truly "passive" income, manual trading is just another "more stressful" job
Yes, If you have an idea that you believe can improve the performance of this strategy, I will be more then happy to hear from you. Please use the contact page to send me a message
No, the source code of the strategy is protected for copyright reasons
Billing
Yes, you can cancel your subscription from the account page at any time to prevent future payments. We cannot refund the unused portion of your subscription, but you will be able to use your subscription even after cancelling for the remainder of the billing cycle.
No, we don't offer a trial subscription plan. But you can download and test the strategy in backtest and playback modes before subscribing
We do not offer full or partial refunds, but you may cancel your subscription at any time to stop future payments.
Skeptics
I have been a professional software developer since 2010. I have been developing automated trading strategies since 2012, for my self for fun and profit and also been developing strategies for clients all over the world
I have always been invlolved professionaly in the business of Finance and Investing, I have worked for trading brokers and investment banking.
I'm not a marketer, and I don't hire someone else to develop my strategies.
This strategy has been favorable for me on the long run with ups and downs, especially when it is run on multiple insturments. But the question remains pertinent, why I'm selling it?
The answer is I'm not selling it, I'm renting it to generate an additional income and diversify my different sources of income besides what this strategy can generate. Which you should also do. You should not rely on one source of income to reach financial independance, the key is diversification.
The edge of this strategy will not disappear if many people start using it. This strategy is purely mechanical and does not rely on a hidden quantitative pattern that should not be disclosed
Lets examine pros and cons of pending orders
- Pros:
- Best price execution when using limit orders
- Protection against losses in case of connectivity issues
- Cons:
- Can get rejected on high price volatility
- Delay between request to place the order and when it gets placed. Price volatility can cause the order to be rejected and the price to run away
- Requires management: any opposite orders need to be canceled
- Visible to the broker, placed orders can be manipulated
After years of developing strategies I reached the conclusion that market orders are better suited for the context of automated trading.
The main drawback of using pending orders is the fact that they can be rejected which is very hard to manage especially in a volatile environment
In all our strategies, we use market orders even for take profit and stop loss. Lets examine the pros and cons of market orders
- Pros:
- Guarantee of execution reagrdless of volatility conditions
- Invisible to the broker before they get submited
- No risk of being rejected which means better protection for stop loss
- Faster execution than pending orders
- Cons:
- In the case of the connection being lost with the broker, the strategy will be unable to send market orders
Remark: MIT (market if touched) orders in NinjaTrader are a solid alternative to pending orders if you really want to use pending orders
We are following the NinjaTrader official guide on how to achieve precise intrabar granularity backtesting by using additional tick level DataSeries See here for more info
Don't take my word for it. Test it yourself, at the end of each trading day, run a backtest of the strategy on that day and compare it with the live trades the strategy made during the day.
Release Notes
- First release of the strategy
User Comments & Feedback
You can find feedback of our users and ask questions about this strategy by joining our discord community by following this invite link or clicking on the Discord logo image. Joining is completely free