![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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;
}