Error handling of incorrect indicator parameters?

To add comments, please log in or register
Raphael Schwietering
8376
Raphael Schwietering  

Hi,

how can i realise it? I want to sell an ea to market. but the moderator told me that.

Please do not close the product strictly, you can just show message in logs.


I have an Ea with different indicators working. Now i want to check the indicators parameters are correct.


//+------------------------------------------------------------------+
//|Check for input parameters Bollinger Bands                        |
//+------------------------------------------------------------------+
   if(Period<2 || Deviations==0.0)
     {
      printf("Incorrect values for input variables Bollinger Bands");
      return INIT_PARAMETERS_INCORRECT;
     }

Thats my code in OnInit().


How did i do that the ea do not close strictly. When i set incorrect values without the input check than the error message will be : cannot load indicator Bollinger Bands

Alain Verleyen
38980
Alain Verleyen  
Raphael Schwietering:

Hi,

how can i realise it? I want to sell an ea to market. but the moderator told me that.


I have an Ea with different indicators working. Now i want to check the indicators parameters are correct.


Thats my code in OnInit().


How did i do that the ea do not close strictly. When i set incorrect values without the input check than the error message will be : cannot load indicator Bollinger Bands

You have to talk to the moderator in your product's section.
Raphael Schwietering
8376
Raphael Schwietering  
Alain Verleyen:
You have to talk to the moderator in your product's section.
In did but He said that ea Not stop ditectly.. So it must something like a Break and not initialisation failed
Alain Verleyen
38980
Alain Verleyen  
Raphael Schwietering:
In did but He said that ea Not stop ditectly.. So it must something like a Break and not initialisation failed
Answer him he is stupid.
Raphael Schwietering
8376
Raphael Schwietering  
Alain Verleyen:
Answer him he is stupid.

thats not a good answer. i really like to have an opportunity how to realise it

nicholi shen
2391
nicholi shen  
Alain Verleyen:
Answer him he is stupid.
Alain Verleyen:
Answer him he is stupid.

Reported for violating rule #1,

Please be polite when communicating on this website. Refrain from statements that may offend or insult other users.

https://www.mql5.com/en/forum/172166/page2#comment_6774976

General rules and best pratices of the Forum.
General rules and best pratices of the Forum.
  • 2018.01.29
  • www.mql5.com
General rules, enforced by moderators : ‌...
Enrique Dangeroux
551
Enrique Dangeroux  
Raphael Schwietering:

thats not a good answer. i really like to have an opportunity how to realise it

I think Alain means, try to convince the product moderator that substitute one fatal error with another is not the solution and that the current situation is correct.

Enrique Dangeroux
551
Enrique Dangeroux  
nicholishen:

Reported for violating rule #1,

Please be polite when communicating on this website. Refrain from statements that may offend or insult other users.

https://www.mql5.com/en/forum/172166/page2#comment_6774976

;) The question is, is the product moderator a "user"?

Raphael Schwietering
8376
Raphael Schwietering  
Support Team:
2018.04.02 13:10:29.287    Core 1    tester stopped because OnInit failed
Please do not close the product strictly, you can just show message in logs.

Thank you.

but what should i do? if we enter invalid parameters the indicator cannot load. so the indicator needs right parameters. if not the error cannot load is coming. and now should i have to do that the ea will automatically put right parameters. In my opinion is when someone enter wrong parameter than he get a message in logs like 

2018.04.02 14:48:00.815 Core 1  2018.01.01 00:00:00   Incorrect values for input variables Bollinger Bands
cause of this wrong values ea would not run so i stop it ! 

[Deleted]
Support Team 2018.04.02 13:48 #4  EN
but what should i do? if we enter invalid parameters the indicator cannot load. so the indicator needs right parameters. if not the error cannot load is coming. and now shoul i have to do that the ea will automatically put right parameters. In my opinion is when someone enter wrong parameter than he get a message in logs like 

cause of this wrong values ea would not run so i stop it ! 

Perhaps you can show a message like this:

 Incorrect values for input variables
and then the product just won't work till the user stop it.



we ask you to do it this way because if you leave it as now it can be cause of future problems with auto validation.


Thats the communications with moderator:

And now i have to do that code:

//+------------------------------------------------------------------+
//|Check for input parameters Bollinger Bands                        |
//+------------------------------------------------------------------+
   if(Period<2 || Deviations==0.0)
     {
      printf("Incorrect values for input variables Bollinger Bands");
      return INIT_PARAMETERS_INCORRECT;
     }

into this they want :

Perhaps you can show a message like this:

 Incorrect values for input variables
and then the product just won't work till the user stop it.



we ask you to do it this way because if you leave it as now it can be cause of future problems with auto validation.
Enrique Dangeroux
551
Enrique Dangeroux  
Raphael Schwietering:

Well... There you have it.

William Roeder
19817
William Roeder  
Raphael Schwietering: In did but He said that ea Not stop ditectly.. So it must something like a Break and not initialisation failed

So why don't you do exactly as requested.

bool isInitOK;//234011
//+------------------------------------------------------------------+
//|Check for input parameters Bollinger Bands                        |
//+------------------------------------------------------------------+
   if(Period<2 || Deviations==0.0)
     {
      printf("Incorrect values for input variables Bollinger Bands");
      isInitOK = false;
      return 0;//234011 INIT_PARAMETERS_INCORRECT;
     }
   :
   isOnitOK=true;//234011
   return 0;     //234011
} // OnInit
OnTick(){
   if(!isInitOK) return;//234011
12
To add comments, please log in or register