Alberto_jazz: If I use the indicator in an expert as iCustom(NULL,0,"Stoch Difference",0,2) I obtain the error "invalid integer number as parameter 2 for 'iCustom' function".
- A compile error in an EA is a problem with the EA. Why show us the indicator code?
- Detailed explanation of iCustom - MQL4 forum
Alberto_jazz:
'That is because NULL is not a valid parameter for the time-frame
This is how I call the indicator in the expert
double Stoch_Diff = iCustom(NULL,NULL,"Stoch Difference",0,1) ;
When I compile the expert I have no errors, but when I apply the expert to the chart I obtain "invalid integer number as parameter 2 for 'iCustom' function".
Alberto_jazz:
This is how I call the indicator in the expert
double Stoch_Diff = iCustom(NULL,NULL,"Stoch Difference",0,1) ;
When I compile the expert I have no errors, but when I apply the expert to the chart I obtain "invalid integer number as parameter 2 for 'iCustom' function".
Try
double Stoch_Diff = iCustom(NULL,0,"Stoch Difference",0,1) ;
honest_knave:
thanks lot. me too had same problem with my indicator. after putting 0. it is working well.
Try
- You can use NULL in place of _Symbol only in those calls that the documentation specially says you can. iHigh does, MarketInfo does not. OrderSend does not.
- Don't use NULL (except for pointers where you explicitly check for it.) Use _Symbol and _Period, that is minimalist as possible and more efficient.
- Zero is the same as PERIOD_CURRENT which means _Period. Don''t hard code numbers.
- No need for a function call with iHigh(NULL,0,s) just use the predefined arrays, i.e. High[].

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
Hi all, I created a simple indicator as the difference between the Stoch(5.3.3) and his signal line.
The indicator works well in his window, if I print the value I seem it's ok.
If I use the indicator in an expert as iCustom(NULL,0,"Stoch Difference",0,2) I obtain the error "invalid integer number as parameter 2 for 'iCustom' function".
Where is the problem? Thank you!