Summary
The X Swings Strategy is a mechanical trend-following NinjaTrader 8 Strategy. It is a full-auto strategy that can be run on autopilot and can be used to pass propfirms evaluation challenges
We highly recommend joining our discord community by following this invite link
Index
Prequisites
To use this strategy you should have available the following prequisites
- NinjaTrader 8. Click here to download
Description
The X Swings strategy is a trend-following strategy that is designed to be run on trendy micro futures instruments such as the MNQ or MCL. The strategy aims to be profitable in the long term by generating a positive expected return determined by a win/loss ratio that is higher than 1.
The strategy can be used on a price based bar-type such as UniRenko or a time based bar-type. Refer to the preferred settings section to check out our suggested parameters for the preferred UniRenko candles
The strategy gets armed when a certain conditions are met:
- For a long entry :
- X consecutive higher low swings are observed
- For a short entry :
- X consecutive lower high swings are observed
Along with this first condition the strategy will look for a specific setup related to the Point of Control (POC) on the last couple of candles
How the strategy manages its positions:
The strategy has two methods to manage its positions.
- Dollar Cost Averaging method or a Grid method
- The price goes in the opposite direction of the trade without a pullback and hits the Stop-Loss target
- The price goes in the winning direction of the trade and hits the profit target
- The price chops around and shows hesitation to go in a direction. In this case, the strategy will try to exit the position as fast as possible by a dollar cost averaging method that consists of increasing the position size whenever a price swing is closed on the losing side of the trade.
This will bring the take profit level closer but will also bring the stop loss level closer to the current price.
In the same time, the strategy has a maximum risk per trade that cannot be exceeded. The increasing of the psition quantity is managed.
Furthermore, the strategy has the ability to set the position to breakeven if an opposite signal is dispatched
- Trailing Stop Method
In this method, each position opened with the strategy can have one of these three scenarios:
When this method is used, the stop loss of the position will be trailed following the last formed higher low (for a long position) or the last lower high (for a short position)
Features
The X swings strategy has a set of unique features:
- No pending orders are placed: only market orders
- Full-auto strategy that can be scaled into multiple instances
- Precise backtesting capabilities following NinjaTrader official best practices to obtain precise entry/exit backtesting on tick level
- Robust in-house Order management library. Resistant to connection loss and works seamlessly on Rithmic accounts or NinjaTader brokerage accounts
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 X Swings Strategy:
Parameters
We try to keep the parameters to minimum. We only left the most important parameters to be set
General | |
Backtest Mode | This parameter is very important and should be used carefully. This parameter should be set to true (checked) whenever the strategy is run in Historical, Backtest, or Optimization modes. When running the strategy in Live Real-Time mode this parameter should be set to false (unchecked). |
Draw POC on Each Bar | This parameter will draw the Volume Point of Control as a yellow line on each bar |
Swings Merge Ticks | This parameter defines the sensitivity to merging successive higher highs and lower lows if they are too close to each other. The threshold set in this parameter is the maximum number of ticks that separate two swings for them to be merged. |
Daily TakeProfit | 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 | 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 |
Swings 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. I personally use the value of 3 or 4 for this parameter. |
Draw Price Swings | This parameter will enable/disable the drawing of swings on the chart. Swings will always be analyzed and processed regardless of this parameter which only affect visibility and render. |
Entry Setup | |
Trade Time | This parameter is very important and can be delicate in some cases. This parameter is used to determine the time intervals in which the strategy is allowed to place trades. The time zone that should be used while setting this parameter value should be the Time Zone of the machine on which NinjaTrader is executed.
Here are some examples for more clarifications:
|
Entry Mode |
This parameter is useful if you already have a directional bias and want to restrict trading to a specific direction long or short
|
Trend Swing Count | This parameter will set the minimum number of consecutive increasing lower low swings to enter a long trade, and higher high swings to enter short trade |
Both HH/LL Trend Condition | When enabled, this parameter will require that both higher highs and lower lows satisify the trend condition for long and short entries. For example to enter a long trade and with a Trend Swing Count value of 2, this parameter will require that the last 2 higher highs and the last 2 lower lows are increasing in price. If it was not enabled, only the last 2 lower lows increasing would be sufficient |
Enable POC Condition | When enabled, this parameter will add the condition of the POC (volume point of control) on one of the last couple of bars. The condition is satisfied whn the POC is above the open price of a bearish candle or below the open price of bullish candle. The other previous parameter Draw POC on Each Bar allows to visualize POCs on each candle |
Order Qty | This parameter sets the quantity of each order to be traded. In the case of increasing orders, this quantity is also used for each increase. Generally, We would use the values 1 or 2 for this parameter for the MNQ and MES insturments |
Order Management | |
Order Management Strategy |
|
On Opposite Signal |
|
StopLoss Strategy |
|
TakeProfit Strategy |
|
Max Stop Loss Currency | This sets the max risk in dollars for the open position. |
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 |
DCA (Grid) Parameters | |
Breakeven Profit Shift | When the DCA method is selected, this parameter will modify the definition of a breakeven and adds a bit of profit to it. This is useful to cover the cost of commissions when closing the grid in breakeven |
Grid Size to Breakeven | When the DCA method is selected, this parameter will set the number of order increases required to start consider closing the position in breakeven |
Min Ticks To Increase Qty | This parameter sets the minimum required number of ticks that separate the current price from the average position price before increasing the quantity of the position. The current price needs to be on the losing side of the position. This created a DCA (dollar cost averaging) effect on the position. You can set this value to 0 or a very big number to disable quantity increase and let the position get closed by either stop-loss or take-profit. |
Subscription Vs. One-time Purchase
As I mentioned earlier, the strategy can be downloaded, installed and run in Historical, Playback, and Optimization modes without the need for an active subscription license.
To run the strategy in live Real-Time mode a subscription license is required. I have decided to use the subscription model rather than the one-time purchase model
The one-time purchase model is used by marketers and fake gurus to sell you strategies that they don't use themselves. Their goal is to generate money from selling you the product and thats it. They have no intention to build a long term relationship with their clients nor seriously provide client support or provide custom development service.
By offering the subscription model through my business I aim to build a long relationship with you. you will be able to cancel your subscription at any time with no questions asked. You can also resume/cancel your subscription any time according to your needs and schedule. I will also provide unlimited support and will provide the possibility to answer custom development requests
Also did I mention that by subscribing you get to access all the products catalog, currently available and future ones. :)
To purchase a subscription follow this link to the pricing page Subscribe Now
Download & Installation Instructions
The strategy can be downloaded and run on Backtest, Playback, and Optimization modes for free without the need for an active license that is only required for running the strategy on Live Real-time mode. To download and install the strategy follow the instructions below
- If you don't already have the UniRenko bar type installed, you can download it from here:
- Click on the below download button to download the XSwings strategy file
- Import the downloaded .zip file into NinjaTrader using the import NinjaScript menu item
- Next, open a new chart window with the following settings.
- On the new chart settings, make sure you enable the Tick Replay check box
- 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.
- 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 controls to 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 first or to login
- Click on the Check License Button
- At this step the strategy will check the License and activate/deactivate trading according to the license validity
- If the license is valid you will see the "Check License" button turned to green, and the next billing cycle displayed next to your email. License check is only required once. Until the next biling cycle date.
- At this stage, the strategy is ready to be run in all modes of execution
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. The only manual intervention it needs is to restart it each day
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 profitable 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.
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
- Updated parameters and functionalities
- First Release of the strategy as a free strategy