I have coded a simple indicator to display the 'net change since open' for my instruments in Market Analyzer. Below is the code I have in OnBarUpdate.
double myOpen = CurrentDayOHL().CurrentOpen[0];
double percentChange = Math.Round(((Close[0] - myOpen) / myOpen) * 100, 2);
PC.Set(percentChange);
The issue I am having with the use of the CurrentDayOHLindicator is that the value returned by CurrentDayOHL().CurrentOpen[0] is the value of the Open at the time when the Market Analyzer is started. So, if I start the Analyzer at 10EST, then the value of the open is the value at 10EST and not 9:30EST.
If I refresh the analyzer, the value of myOpen becomes the value of Open at the time the refresh is done.
I thought the value returned by CurrentOpen would be static - Open of the day. What is the right way to use this indicator in MA.
thanks
Comment