Could anyone shed some light on this?

I further tried following code based on the manual:

if(between(hour(),19,23) or between(hour(),0,5)) //outside market hours --> skip and ignore those bars
{
TimeFrame = 0;
SkippedBars--; // count negative number of bars outside market hours
}
else if(hour()==6)
{
TimeFrame=SkippedBars; // end this timeFrame
SkippedBars = 0;
}
else if(between(hour(),7,17)) //the hours I want to trade and use as an input for my indicators;
{
TimeFrame=0;
BarsPerMarketDay--;
}
else if(hour()==18) //Market Closes --> combine all market hours bars to one and use as an input for SMA, RSI, etc.
{
TimeFrame=BarsPerMarketDay;
BarsPerMarketDay = 0;
}
vars PriceD1 = series(priceClose()); //my problem is that it fills in also the price bar from the closed market hours that I do not want to have in here
//vars smaD = series(SMA(PriceD1,3)); //create an SMA of my last three market days

plot("PriceD1",PriceD1,MAIN,RED); // seems to work, but not sure if outside market hour bar is ignored or just a 2nd daily bar

//plot("smaD",smaD,MAIN,BLUE); // DOES NOT WORK AS INTENDED


Can anyone explain what is going wrong here and how to solve it?
It seems to me that the only way around this is to write several loops as there does not seem to be a way around this.

I was also wondering if anyone traded multiple FXCM cfds on daily bars, which does not seem to be an easy endeavour with Zorro as each cfd is traded during different market hours.

Last edited by Ger1; 08/18/17 08:10.