Are there any known issues with calling iCustom from an indicator? I am making a signal generator indicator that checks multiple other custom indicators my system uses. I have an order management EA running on the chart hence why I have gone this route. I have the function below to check against the custom indicator, which I am sure is right, its hardly complex code. When the indicator is first launched and for several hours after checks are made without issue, the correct values are reported, but this morning it did not signal when I expected. I have all the indicators loaded onto the chart at the same time for testing purposes, and because it is a manual system so I still need to know what it happening. Checking the logs I had:
05:30:04 - - - CheckForexTrend: M15 result = -10: ind_buffer_1 = 0 ind_buffer_2 = -0.5014 -
...
The result received below is impossible for this indicator.
11:00:09 - - - CheckForexTrend: M15 result = 10: ind_buffer_1 = 0 ind_buffer_2 = 0
...
Later on in the log I then saw, the below, the same value was being reported multiple times (only listed twice here but it appeared four times), again impossible/highly unlikely.
13:45:02 - - - CheckForexTrend: M15 result = -10: ind_buffer_1 = 0 ind_buffer_2 = -0.3962
14:00:05 - - - CheckForexTrend: M15 result = -10: ind_buffer_1 = 0 ind_buffer_2 = -0.3962
My question I guess is, if the indicator is on the chart at the same time as it is checked via iCustom are there chances of any conflicts? Other members of the group I am making this for also reported repainting of indicators they had not noticed before since using the signal generator. I have no idea why. Any help would be greatly appreciated.
//--------------------------------------------------------------------------------//Function: CheckForexTrend//Purpose: Make check against Forex Trend for alignment to the trade direction.//Inputs: string Symbol_ // int Period_//--------------------------------------------------------------------------------int CheckForexTrend(string Symbol_, int Period_, int indicator_period) {
int result = NEUTRAL;
double ind_buffer_1 = iCustom(Symbol_,Period_,"FXCX Forex Trend",indicator_period,1,1);//Limedouble ind_buffer_2 = iCustom(Symbol_,Period_,"FXCX Forex Trend",indicator_period,2,1);//Red if(ind_buffer_1 != 0.0) result = BUY;
if(ind_buffer_2 != 0.0) result = SELL;
string AlertMessage = StringConcatenate("CheckForexTrend: ",PeriodToString(Period_)," result = ",result,
": ind_buffer_1 = ",ind_buffer_1," ind_buffer_2 = ",ind_buffer_2);
log(AlertMessage);
return(result);
}//end CheckForexTrend(string Symbol_, int Period_)
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.
05:30:04 - - - CheckForexTrend: M15 result = -10: ind_buffer_1 = 0 ind_buffer_2 = -0.5014 -
...
The result received below is impossible for this indicator.
11:00:09 - - - CheckForexTrend: M15 result = 10: ind_buffer_1 = 0 ind_buffer_2 = 0
...
Later on in the log I then saw, the below, the same value was being reported multiple times (only listed twice here but it appeared four times), again impossible/highly unlikely.
13:45:02 - - - CheckForexTrend: M15 result = -10: ind_buffer_1 = 0 ind_buffer_2 = -0.3962
14:00:05 - - - CheckForexTrend: M15 result = -10: ind_buffer_1 = 0 ind_buffer_2 = -0.3962
My question I guess is, if the indicator is on the chart at the same time as it is checked via iCustom are there chances of any conflicts? Other members of the group I am making this for also reported repainting of indicators they had not noticed before since using the signal generator. I have no idea why. Any help would be greatly appreciated.