PDA

View Full Version : Changing historical bar values, Median?


heech
12-08-2008, 01:08 PM
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.)

NinjaTrader_Josh
12-08-2008, 01:16 PM
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/HelpGuideV6/DiscrepanciesReal-TimeVsBacktest.html

RJay
12-08-2008, 01:30 PM
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

heech
12-08-2008, 01:43 PM
Okay, back to the drawing board. I'll double check my parameters to make sure they haven't changed.