I created a new indicator that I am using in Market Analyzer but for some reason the Prior Day OHLC values are unpredictable. In the indicator I am simply printing out the values for the current day OHL and prior day OHLC and 200 bar SMA and 200 bar EMA using 1 minute chart. If I look at the values that get printed out via my indicator versus opening a chart and adding the Prior Day OHLC indicator to the chart, the values are different.
Here is a snippet of code that prints out the lines when OnBarUpdate gets called:
if (PriorDayOHLC().PriorClose.ContainsValue(0))
Print("Prior Close: "+ PriorDayOHLC().PriorClose[0].ToString("C"));
if (PriorDayOHLC().PriorHigh.ContainsValue(0))
Print("Prior High: "+ PriorDayOHLC().PriorHigh[0].ToString("C"));
if (PriorDayOHLC().PriorLow.ContainsValue(0))
Print("Prior Low: "+ PriorDayOHLC().PriorLow[0].ToString("C"));
if (PriorDayOHLC().PriorOpen.ContainsValue(0))
Print("Prior Open: "+ PriorDayOHLC().PriorOpen[0].ToString("C"));
Print("Current High: "+ CurrentDayOHL().CurrentHigh[0].ToString("C"));
Print("Current Low: "+ CurrentDayOHL().CurrentLow[0].ToString("C"));
Print("Current Open: "+ CurrentDayOHL().CurrentOpen[0].ToString("C"));
Print("SMA 200: "+ SMA(200)[0].ToString("C"));
Print("EMA 200: "+ EMA(200)[0].ToString("C"));
Any ideas on why we would have some sort of discrepancy?
Thanks for any help!
- Eric
Comment