When you come across invalid settings you should exit the test run as early as possible, during initialization. This will avoid
unnecessary cluttering of the
test
results.
use void OnTick() instead of int start()
use int OnInit() instead of int init()
add this to your OnInit:
Hi i have got it working using the int init() but when i tried to add in a little more functionality i get unbalanced parentheses. However i
cannot seem to put a parenthases in the right place to get rid of the error. I have included a boolean UseTimeSlot and thought it would work as
below (I don't think i need an Else but i tried that too) but can not seem to get it right. Any ideas?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
When you come across invalid settings you should exit the test run as early as possible, during initialization. This will avoid unnecessary cluttering of the test results.
Hi i have got it working using the int init() but when i tried to add in a little more functionality i get unbalanced parentheses. However i cannot seem to put a parenthases in the right place to get rid of the error. I have included a boolean UseTimeSlot and thought it would work as below (I don't think i need an Else but i tried that too) but can not seem to get it right. Any ideas?
Thanks Paxman
int init()
{
if UseTimeSlot = false
{
NumberOfMins = 15
}
{
if(60*EndHr+EndMn<=(60*StartHr+(StartMn+NumberOfMins))) //extern bool UseTimeSlot = false;
{
Print("invalid trading time");
return INIT_PARAMETERS_INCORRECT;
}