Changing StartMarket produces wrong data in dayHigh for Tokyo

Posted By: Figurehunter

Changing StartMarket produces wrong data in dayHigh for Tokyo - 01/07/21 23:23

I want the OHLC for the three main sessions: New York, London and Tokyo

Using dayOpen/Close/High/Low works for all three if I keep with the default StartMarket times of 0930 and EndMarket of 1600

If I change to FOREX hours with a StartMarket of 0800 it still works for New York and London but it FAILS for Tokyo

The failure is only within the first hour which occurs on the previous day in UTC time. Instead of starting fresh with the new sessions Highs and Lows it starts with the previous sessions Highs and Lows.

I plotted the results. Highs and Lows for each session. New York in Red, London in Lightblue and Tokyo in Yellow.

[Linked Image]

Now that I plotted it and finished this post I realized that the Highs and Lows auto-corrects itself and all future data is correct so this might be a plotting issue instead.

Code
	vars Price = series(price());


	StartMarket = 0800;
//	EndMarket = 1600; no change default



	var DEOpen = dayOpen(ET,0);
	var DEHigh = dayHigh(ET,0);
	var DELow = dayLow(ET,0);
	var DEClose = dayClose(ET,0);
	
	var DLOpen = dayOpen(WET,0);
	var DLHigh = dayHigh(WET,0);
	var DLLow = dayLow(WET,0);
	var DLClose = dayClose(WET,0);
	
	var DJOpen = dayOpen(UTC+9,0);
	var DJHigh = dayHigh(UTC+9,0);
	var DJLow = dayLow(UTC+9,0);
	var DJClose = dayClose(UTC+9,0);
	
	if(market(EST,0))
	{
	plot("USAHigh",DEHigh, LINE,RED);
	plot("USALow",DELow, LINE,RED);
	}

	if(market(WET,0))
	{
	plot("LondonHigh",DLHigh, LINE,LIGHTBLUE);
	plot("LondonLow",DLLow, LINE,LIGHTBLUE);
	}
	
	if(market(JST,0))
	{
	plot("TokyoHigh",DJHigh, LINE,ORANGE);
	plot("TokyoLow",DJLow, LINE,ORANGE);
	}

Posted By: Figurehunter

Re: Changing StartMarket produces wrong data in dayHigh for Tokyo - 01/09/21 14:52

I have confirmed that this was a plotting issue but would still like to fix it. Either bug or user error but since I am very new to Zorro it is more likely user error.
© 2024 lite-C Forums