![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jul 2012
Posts: 13
Thanks: 2
Thanked 0 times in 0 posts
|
Hi,
I started testing trading strategies on NinjaTrader vs. TradeStation. For parallel comparison, I imported Historical Data from TradeStation. So, what I've found is that there are cases where trade signal Triggered on TradeStation but not triggered on NT. One of the reason I have confirmed is that on TradeStation, the backtesting assumes you can double entry in the same bar, e.g: when signal reverses TS proceeds as first cover the previous Long/Short and then reverse Short/Long. In NT, it doesnt allow signal reversing inside same bar. for the above case, when signal reverses, it would cover position in this bar, and enter a reverse buy/sell on next bar. I am not sure which one is more realistic. However, there is another big discrepancy in indicator value calculating and Bar constructing. So, assume that I have perfectly copy my strategies from EasyLaguage to C#. I would say it is 100% correct, as I tested some of the strategies on both platform and generated say 95% similar results. Plus I re-assured the trade being executed are all match-up. The problem is, okay all the trades are signal based, when the indicators are plotted correctly, the trades are correct trades. However, I happened to do some due diligence, and found out that there are 5% of chance that some indicators plotted on TS are different than that on NT, sometimes its slighlty different, sometimes its BIG. I understand this feels like an inevitable issue as these are two different platforms, but I just want to know if this is what cannot be resolved. Also, NT has really fast optimization speed, and given that we are able to optimize a lot of parameters, which could be a double sword. (overfitting)... Sorry it is a long thread, there should be an explanation from NT, or even TS. Its about reliability, and consistency. I love NT, more than TS, but when you see something performed great on NT but moderate on TS, you start to be skeptical. Thanks, Steve |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
|
Hello Steve,
Please review the information in the following link which explains why there can be discrepancies in back testing: http://www.ninjatrader.com/support/h...ime_vs_bac.htm If you're looking for Intrabar granularity in your backtesting, this can be done by adding a lower time frame to your script: http://www.ninjatrader.com/support/f...ead.php?t=6652 Regarding the different indicator values, can you verify the start/end time for the bars you're using in NT vs TS? It could be that you are using a session template in NinjaTrader that is looking at a different start/end period than you seeing your TS charts.
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jul 2012
Posts: 13
Thanks: 2
Thanked 0 times in 0 posts
|
Thanks for the quick response and references.
Yea, the time sessions seem to be the problem. Even tho charts are almost the same but the time stamp is completely different, What do you mean the time session template? How do I synchornize them? Should I used instrument default in the template setting? im testing on FX futures btw
Last edited by ell2230; 07-20-2012 at 09:44 AM.
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
|
Hello,
The session template is set by right clicking on the chart--> select "Data Series"--> session template You will also have this option when backtesting, or starting a strategy. You can verify the session times under Tools--> Session Manager More information using the Session Manager and Session Templates: http://www.ninjatrader.com/support/h...on_manager.htm Please also review our Help Guide article on 'How Bars are Built': http://www.ninjatrader.com/support/h..._are_built.htm
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#5 | |
|
Junior Member
Join Date: Jul 2012
Posts: 13
Thanks: 2
Thanked 0 times in 0 posts
|
Quote:
I read all the references and could not solve the problem I have. I did some investigation, finding that the time stamp on Ninjatrader lagged by 5 hours. So as of the time 7:35am on TradeStation which is the correct time, it shows 2:35 on NT. I am testing on Canadian dollar, I tried both default template and CME FX Future ETH template. Neither work correctly. |
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
|
What time zone are you located in? What time zone is your local PC clock set to? What operating system are you using?
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Jul 2012
Posts: 13
Thanks: 2
Thanked 0 times in 0 posts
|
Im in Chicago so, Central Time Zone,my local machine is set to Central Time GMT-6:00. OS: Windows XP
|
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
|
Hello,
I see - NinjaTrader will always time stamp your bars based on your local PC clock, however if this data was imported from TradeStation, there may be an issue with how the data was imported. When you exported the data from TradeStation, did you have the Display: Time Zone setting set to Local time, or another? When importing in NinjaTrader, did you have "Time Zone of Imported Data" set to UTC as per default, or did you set it to the same settings you used when exported from TradeStation?
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Jul 2012
Posts: 13
Thanks: 2
Thanked 0 times in 0 posts
|
I did not modify any time settings when both importing and exporting data between TS and NT, that means all by default.
I clearly remember what I did was: 1) load the 1min Chart on TS (correct time stamp) ; 2) insert NTDataDownload Strategy 3) Import the txt file on NT, with UTC left as default Should I change any time settings? how? |
|
|
|
|
|
#10 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
|
Hello,
By default, TS will export as local time, however our default settings are UTC. To correct this, you will need to delete your historical data in NinjaTrader and reimport making sure to set the Time Zone in the Historical Data Manager/Import tab to use the same time zone that TradeStation is using.
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
Junior Member
Join Date: Jul 2012
Posts: 13
Thanks: 2
Thanked 0 times in 0 posts
|
Thanks. That seems to work. I am trying to redo everything.
Just a quick question regarding backtesting vs. TradeStation. In TS, we have this check box to make sure limit order gets triggered on when price is traded through. Also, intra bar double entries could happen on TS. I wonder if this is the case on NT? I am more care about "Trade Through" setting on NT, I heard that the default fill type is similar to "Trade Through"? right? |
|
|
|
|
|
#12 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
|
Correct - Default fill type will only fill if the price was penetrated.
Liberal would fill if the price was touched.
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Jul 2012
Posts: 13
Thanks: 2
Thanked 0 times in 0 posts
|
What if we have Profit Target and Stop loss would happen all the in the same bar. Would NT stop it out first or take profit first? suppose we have a very small target?
|
|
|
|
|
|
#14 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
|
Only one event will be processed and this occurs the the close of the bar on a single data series strategy. There is no way to predict which event (profit or stop) will be executed.
If you would like intrabar granularity, you would need to at a higher resolution by adding a tick series for example. In this case, it would hit which ever price was penetrated first.
Matthew
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Matthew for this post: |
|
|
|
#15 | |
|
Junior Member
Join Date: Jul 2012
Posts: 13
Thanks: 2
Thanked 0 times in 0 posts
|
Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NinjaTrader with TradeStation | bjm051593 | Connecting | 2 | 09-09-2011 02:17 PM |
| TradeStation to NinjaTrader | pistolpete | Automated Trading | 1 | 03-01-2011 09:57 AM |
| real-time vs backtesting discrepancy | lself | Automated Trading | 10 | 06-01-2009 08:01 AM |
| Tradestation vs NinjaTrader | stepwise | General Programming | 15 | 05-25-2007 07:15 AM |
| Tradestation vs NinjaTrader | stepwise | ATM Strategies (Discretionary Trading) | 1 | 12-31-1969 06:00 PM |