Probelm with price history data in a multi pair indicator

 

I'm working on writing an indicator that looks at the closing price in many of the major pairs and then multiples them together and stuff.

The problem is that in a certain place in each time frame, the results in the indicator change drastically. There's nothing in my program that changes at this point so I assume it's something to do with the source of the price history data.

Here's the M15 chart, as you can see it's amplitude is much smaller after Feb 2nd, although if you zoom in that area is just as jagged.

Since I don't really know what to expect from the algorithm of the indicator, other then that it should oscillate back and forth around 1, I couldn't tell you which area is correct or if either is. But for sure both areas can't be modeling correctly.

Also it doesn't happen in the M1 chart.

In the M5, M15, M30, H1 chart it happens at Feb 2nd.

In the H4 chart it happens at 11/1/2013

In the D1 chart it happens at 11/1/2009

And this is after I deleted all the downloaded data from the History Center, so I assume all the price data is from the broker?

If anyone has any ideas of what could be fundamentally different about the closing price data before and after those spots in my charts I would appreciate it greatly.

 
Wyatt:

I'm working on writing an indicator that looks at the closing price in many of the major pairs and then multiples them together and stuff.

The problem is that in a certain place in each time frame, the results in the indicator change drastically. There's nothing in my program that changes at this point so I assume it's something to do with the source of the price history data.

Here's the M15 chart, as you can see it's amplitude is much smaller after Feb 2nd, although if you zoom in that area is just as jagged.

Since I don't really know what to expect from the algorithm of the indicator, other then that it should oscillate back and forth around 1, I couldn't tell you which area is correct or if either is. But for sure both areas can't be modeling correctly.


Are you certain that you have the data for the pairs that you are trying to use ? how do you ensure that you have the data ? error 4066 ?
 
If any of the price data is 0 then I make the indicator 0. This does happen much further down the chart. Could it be some difference in the way the closing price is calculated by the broker? Like for some time range it averages the bid and ask but for older data it just uses the bid?
 
Wyatt:
If any of the price data is 0 then I make the indicator 0. This does happen much further down the chart. Could it be some difference in the way the closing price is calculated by the broker? Like for some time range it averages the bid and ask but for older data it just uses the bid?
You won't get 0 . . . if you ask for the High of bar 23 for a particular timeframe for a particular symbol and the data is old you will get an incorrect value . . . you won't get 0.
 
Interesting, what do you mean exactly by old data? Say my program uses the iClose function to call data that the broker has available but that I haven't actually downloaded by viewing it on a chart or otherwise, will it download the data at that point or give me garbage?
 
Wyatt:
Interesting, what do you mean exactly by old data? Say my program uses the iClose function to call data that the broker has available but that I haven't actually downloaded by viewing it on a chart or otherwise, will it download the data at that point or give me garbage?
If you ask for bar 23 and bar 23 is old, meaning it hasn't updated you will get the old data and at the same time the new data will be fetched from your Broker and an error 4066 will be generated . . . as an experiment . . . open charts for all the timeframes of all the symbols you use . . . this should keep the data current, then rerun your Indicator.
 

I put a GetLastError() check in the main loop but there's no errors being generated. I opened all the charts to various timeframes but it didn't change anything. Since I've run the indicator many times it should have downloaded all the data the first time anyway.

I also tried changing the indicator line to simply show the closing price of each symbol, one at a time, to make sure they look the same as their charts, like this:

PriceTestBuffer[i]=iClose("USDJPY",0,i);

They all look normal, nothing weird happens around Feb 2nd.

Let me ask you about this, in the History Center all the forex symbols are listed under the forex tab, except EURUSD. Then there's a forex5 tab that only has EURUSD in it. Could that be related? Could the broker be formatting the EURUSD differently for some reason?

history center screenshot