NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 12-04-2008, 12:38 PM   #1
Mike Winfrey
Senior Member
 
Join Date: Aug 2007
Posts: 310
Thanks: 3
Thanked 2 times in 2 posts
Default Entry Price Question

I've noticed this before and figured it must be a result of the simulated order entry algorithm but not sure. In the attached picture notice the area inside the elipse. There is a short that was entered at 486.1 but the low of that bar only got to 486.3. This happens relatively frequently in simulation when running my strategy. Can you please explain why this happens?

Thanks,
Mike
Attached Images
File Type: jpg EMD 12-08 12_4_2008 (3 Range).jpg (59.0 KB, 17 views)
Mike Winfrey is offline  
Reply With Quote
Old 12-04-2008, 12:56 PM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,413
Thanks: 252
Thanked 976 times in 959 posts
Default

Hi Mike,

I assume you are using limit orders in your strategy.

Indeed this is a result of the underlying simulation environment in NinjaTrader.

You see this display because you use limit orders in backtesting and this always creates fill assumptions. Since the signal bar has already closed you can only submit your order on the next bar, but also since you are using Limit orders it is possible to get fills outside of the bar. If this behavior is not what you expect options for you would be to try changing your fill algorithm to 'Liberal'.

The two system fill algorithms are:


Default
An algorithm that takes a conservative and more realistic approach to filling limit and stop limit orders.
  • Limit orders only fill if the limit price was penetrated
  • Limit orders are always filled at the limit price specified never better (for example, if a limit order is submitted on bar n, NT will check if the order is filled on bar n+1, if this bar gaps down and the limit order was a buy, the order would be filled at the limit price and NOT the high of bar n+1)
Liberal
An algorithm that takes a liberal approach to filling limit and stop limit orders.
  • Limit orders fill if the limit price was touched
  • On gap down bars, buy limit orders will fill at the high of the gap down bar
  • On gap up bars, sell limit orders will fill at the low of the gap up bar
As an alternative, you can code your own fill algorithm, please review this link for that purpose - http://www.ninjatrader-support.com/H...FillTypes.html
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 12-04-2008, 02:22 PM   #3
Mike Winfrey
Senior Member
 
Join Date: Aug 2007
Posts: 310
Thanks: 3
Thanked 2 times in 2 posts
Default

Thanks Bertrand,

I figured that was it and now that I know what it is I can deal with it.

However, I'm using EnterLong() and EnterShort() for the time being and so based on the documentation that says I'm entering with a market order. So, does this change your answer any?
Mike Winfrey is offline  
Reply With Quote
Old 12-04-2008, 02:27 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Realtime? Backtesting? Connectivity provider?
NinjaTrader_Josh is offline  
Reply With Quote
Old 12-04-2008, 02:36 PM   #5
Mike Winfrey
Senior Member
 
Join Date: Aug 2007
Posts: 310
Thanks: 3
Thanked 2 times in 2 posts
Default

oh gee...there's never enough information it seems.

yes to realtime but sim account
no to backtesting
zenfire is my datafeed

backtesting in strategy analyzer doesn't exhibit this behavior.
Mike Winfrey is offline  
Reply With Quote
Old 12-04-2008, 02:43 PM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Zen-Fire data is timestamped by them. Executions is timestamped by your PC clock. If you see such discrepancies on market orders it is likely due to out of sync PC clock. Please try resyncing your PC clock.

There is no guarantee this can resolve the issue for you though because as long as Zen-Fire timestamps do not match your PC clock exactly there is no way to make this sync. Executions will always be shown on the chart based on what it was timestamped by your local PC clock even if the data was ahead as timestamped by Zen-Fire.
NinjaTrader_Josh is offline  
Reply With Quote
Old 12-04-2008, 02:51 PM   #7
Mike Winfrey
Senior Member
 
Join Date: Aug 2007
Posts: 310
Thanks: 3
Thanked 2 times in 2 posts
Default

thanks and that makes sense...I have a program running all the time that synchronizes my pc clock and i also restart NT to make sure it has the right time in the event the PC clock has been reset by the resync.

I've never seen that discrepancy when trading my real money account so when I saw it with my strat on sim then I wondered.

Thanks again,
Mike
Mike Winfrey is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to refer to the price of previous entry? justmake General Programming 16 05-28-2010 12:59 PM
How to return the Position Entry Price?? Ninja in Training Strategy Development 3 08-05-2008 10:06 AM
Price Entry and EMA Close gygraham Strategy Development 6 03-21-2008 10:06 AM
Price Entry and EMA Close gygraham Strategy Development 0 03-19-2008 12:38 PM
Order entry question Bubss Strategy Development 2 01-14-2008 07:19 AM


All times are GMT -6. The time now is 05:42 AM.