Showing posts with label backtest,strategy ,NinjaTrader. Show all posts
Showing posts with label backtest,strategy ,NinjaTrader. Show all posts

Friday, May 29, 2015

Choose your ninjatrader strategies/autotrader wisely and carefully

Choose your Ninjatrader strategies/autotraders wisely
There are hundreds of strategies and autotraders available on Ninjatrader platform.
It’s important to carefully select which one to work with to ensure your money and time are both well spent.
Here are some tips to help you make the right decision.

1. Ignore Ads and attractive performance.
You are buying a strategy to make money. When you see a strategy generates a stellar performance, you may not be able to resist your urge to make the purchase.
Company will not show you drawbacks on their frontpage. Most content you see will be about how good they are. I’m not saying they are not as good as they described, but nothing is perfect, sometimes you need to know more about the NOT so good part.

Pay attention to backtest results
I will not say the backtest is totally useless, but there will be a significant difference between backtest and real-time test results because historical trades are not matching real time trades. This is due to the fact that historical data only have the Open, High, Low, and Close prices , not intra-bar tick information.

2. Face Reality
There is no autotrader can continuously make money for you, even if there is one, will you sell it to others? The reason developers sell strategy instead of using it is simply because it’s not very profitable. Please treat an autotrader as a tool not a goose that laid the golden egg.

3. Understand the mechanism
Autotrader is a combination of orders and conditions.
Orders include: enter long and short, exit long and short, profit target and stop loss target. You also need to think about what order type (Limit, Market, Stop, StopLimit) best suits your strategy.
Conditions are where and when the orders should be sent out. It can be a indicator’s signal, a chart pattern or a specific price movement.  Variety in combination results each autotrader to be different.
Before you pay, make sure you completely understand how it works.

4. Simple is good.
I saw a lot of autotraders have toolbar or panel with many buttons.
Do you know that these features are not officially supported by Ninjatrader? Why? Probably because these functions may cause some unexpected issues.
Ask yourself, do those additional functions really matter to you?
Apple beats Blckberry with just one button. Bear in mind, you are not buying a multimedia keyboard.

5. Issue you may encounter
Ninjatrader is a good platform, but its order handling is not very friendly.
The most common problem you may have is overfill, which is caused by either one of the following two conditions;
a.Both Stop Loss and Exit order are filled at the same time;
b.A reversal entry with either Stop Loss or Exit order are filled at the same time;
Reversal entry will generate an Exit order for the previous position in addition to existing Stop Loss or Exist order, overfill is resulted as any two or all of these orders filled within one second with no cancellation on each other.  Sometimes too fast is not too good.
Take a look at how many people having this issue: https://www.google.ca/search?
q=overfill+site%3Ahttp%3A%2F%2Fwww.ninjatrader.com

6. Features you need
Make a checklist of all features you need, such as email notification when an order is filled, or display PnL on chart, etc. Be sure the autotrader you are buying comes with those features. Once the purchase is made, no one else can add additional features for you as the files you received are encrypted. Only the owner can modify it and most vendors do not take on custom project.

Using these tips as a filter, a lot of unqualified strategies/autotraders will be ruled out.
If you have a great trading idea in mind but can’t find any autotrader to fit, it is time for a custom built. If programming is not your expertise, I’m willing to help if I’m not occupied.

Monday, May 25, 2015

What's the best way to backtest your strategy in NinjaTrader?

You should be aware that great discrepancies exist between Real-Time and Backtest.
Let's take a quick look at all possible ways to do a backtest.

Most people will choose Strategy Analyzer as their first option.

However, a major drawback is that its historical data contain only the Open, High, Low and Close with no intra-bar tick information.
Hence, all orders are filled based on four data points (OHLC) as these are only known information during a backtest.


If your entry point is based on the previous bar's close, Strategy Analyzer may still generate results close to real time.

Click here for more info about Strategy Analyzer.
Market Replay will be the second option.
This method is very close to real time live trading.
Orders are filled dynamically as it uses intra-bar tick date (both price and volume) to determine if an order should be filled or not.
The best part of this methold is that you can speed up, forward, hold and backward.
Because fill prices dependant on volume at availabe bid or ask price, some orders may not be filled in live trading even if they can be filled in Market Replay because
Click here for more info about Market Replay.

Simulated Data Feed will be the third option.
You can use this method to test your strategy offline. The advantage is that you can fully control the trend (price directions) as well as to test some special price movements.
Click here for more info about Simulated Data Feed.

Real-Time Simulation is the last possible option.
By running your stategy in real time during the live session, the results are almost the same as live trading.
To apply this method, either to test in your Sim account or turn on the Global Simulation Mode.
When Global Simulation Mode is enabled, all order entry interfaces (SuperDOM, Chart Trader, etc.) will be set exclusively to the Sim101 account. Enabling this is not necessary in order to route orders through simulation, you can still set any order entry interface to the Sim101 account individually.  However, Global Simulation Mode provides you a method to ensure that you do not accidentally place an order to your live trading account.
Simulation_1

Strategy Analyzer Market Replay Simulated Data Feed Real-Time
Intra-bar tick No Yes Yes Yes
Order filled when trading target hit. Yes Yes/No Yes Yes/No
Fill prices you may receive better or worse fill prices dependant on where the bid or ask price is and what volume is available at this market prices.
strategies processed at Close only Tick by Tick
Pros Detailed results speed control trend control clostest to live trading-
Cons unreal results limited amount of replay data No volume Only available during live session

Discrepancies: Real-Time vs Backtest
Click here for more examples of the difference between the realtime and backtest from other traders.