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 > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 12-08-2008, 01:08 PM   #1
heech
Senior Member
 
Join Date: Nov 2008
Posts: 576
Thanks: 0
Thanked 1 time in 1 post
Default Changing historical bar values, Median?

Hi there,

This is a little bit hard to describe.. hard to replicate. But in my code, I've seen my real-time trading results differ from historical execution... there are trades *not* executing real-time that, according to my historical execution, should have executed.

Now, I understand that can often happen. But I thought I was careful to stay away from anything that would make that possible... I'm primarily working in 10m-30m bars. I'm only using OHLC bars, nothing else that should be very tricky.

The only thing I can come up with is maybe my use of Median. Median doesn't come from the broker, right? NinjaTrader calculates it off of OHLC? Is it possible that Median could change substantially from time to time...? (I've also seen, I believe, even historical executions change... which really baffles my mind.)
heech is offline  
Reply With Quote
Old 12-08-2008, 01:16 PM   #2
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

Median does not change provided your data stays the same. Historical executions will show up as it is calculated out by the data presented on the chart. Real-time trades will never be the identical to historical trades. Historical trades are done against OHLC. Real-time trades are always run through the simulator fill algorithm.

http://www.ninjatrader-support.com/H...sBacktest.html
NinjaTrader_Josh is offline  
Reply With Quote
Old 12-08-2008, 01:30 PM   #3
RJay
Senior Member
 
Join Date: May 2008
Location: Hartford, CT. USA
Posts: 618
Thanks: 12
Thanked 24 times in 18 posts
Default

Quote:
Originally Posted by heech View Post
Hi there,

This is a little bit hard to describe.. hard to replicate. But in my code, I've seen my real-time trading results differ from historical execution... there are trades *not* executing real-time that, according to my historical execution, should have executed.

Now, I understand that can often happen. But I thought I was careful to stay away from anything that would make that possible... I'm primarily working in 10m-30m bars. I'm only using OHLC bars, nothing else that should be very tricky.

The only thing I can come up with is maybe my use of Median. Median doesn't come from the broker, right? NinjaTrader calculates it off of OHLC? Is it possible that Median could change substantially from time to time...? (I've also seen, I believe, even historical executions change... which really baffles my mind.)

heech,

Median is defined as the following for each bar, ( H + L / 2 ).

Open and close are not part of the equation.

RJay
RJay is offline  
Reply With Quote
Old 12-08-2008, 01:43 PM   #4
heech
Senior Member
 
Join Date: Nov 2008
Posts: 576
Thanks: 0
Thanked 1 time in 1 post
Default

Okay, back to the drawing board. I'll double check my parameters to make sure they haven't changed.
heech 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
Changing historical bar's color commodity_trader Miscellaneous Support 8 11-05-2008 02:44 PM
Changing Values of running strategy mjuviler Strategy Development 2 09-13-2008 04:09 AM
RegressionChannel historical values ATI user General Programming 2 03-13-2008 06:53 AM
Getting Historical Values Using DataSeries.. nmussa General Programming 4 10-03-2007 07:47 AM
Changing Stop/target values in Control Center while Strategy running zoltran Miscellaneous Support 1 04-11-2007 02:40 AM


All times are GMT -6. The time now is 05:07 PM.