Invalid Bar Setup

Posted By: leohermoso

Invalid Bar Setup - 10/25/21 22:42

I found this while upgrading from 2.35 to 2.40

Running the simple code

Code
function run() 
{
	LookBack = 1600;
	set(LOG + PARAMETERS);
	setf(PlotMode, PL_ALL + PL_FINE);
	MaxLong = MaxShort = -1;
	BarPeriod = 1;
	BarOffset = 60 * 9;
	
}


There are no errors when I click trade, however the same code on 2.40 triggers a
Code
Registered: Zorro S Subscription


_New compiling...........
Login 0 MT4/5..
!ZorroMT4.dll V4.26.
!Modal DTVM Ltda.  connected at UTC 10-25 22:30
Error 030 - invalid bar setup
Logout.. ok



I think you could take a deeper look into this.

Tks in advance

Leo Hermoso
Posted By: Petra

Re: Invalid Bar Setup - 10/26/21 10:31

Wrong bar offset?
Posted By: leohermoso

Re: Invalid Bar Setup - 10/26/21 11:15

Maybe, my point is: The same code run nicely on zorro 2.35 but throw the above error on zorro 2.4
Posted By: AndrewAMD

Re: Invalid Bar Setup - 10/26/21 12:06

The error message says that you have an invalid bar setup. Perhaps you should fix your bar setup.
Posted By: leohermoso

Re: Invalid Bar Setup - 10/26/21 13:39

Sorry Guys, maybe I was not clear, and I will try again!


IF I run the script above in the ZORRO VERSION 2.35 I see NO error message, right?

BUT, if I run the exact same script in ZORRO VERSION 2.40 THERE'S AN ERROR MESSAGE!


VERSION 2.35 NO ERRORS - SAME SCRIPT
VERSION 2.40 ERROR - SAME SCRIPT


I suggest you try to reproduce the problem as the step-by-step was provided.

Best regards.
Posted By: AndrewAMD

Re: Invalid Bar Setup - 10/26/21 14:03

Version 2.40 better detects your script bugs. This is a good thing.

Also, do you see how your BarOffset is greater than your BarPeriod? That's illegal. It can be "0 or a positive number smaller than BarPeriod".
https://zorro-project.com/manual/en/barperiod.htm
Posted By: leohermoso

Re: Invalid Bar Setup - 10/27/21 12:08

Andrew, thank you very much! I think I completely misunderstood the BarOffset.
© 2024 lite-C Forums