- Home
- Community
- Programming
- MetaTrader iCustom
MetaTrader iCustom
I have the outlook indicator installed in MT4. I can see the lots lines plotted against the chart data, which is fine, but I want to use those values in an alert generating system/EA, so I call the indicator using the iCustom() function in MQL4.Demo code:
int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]){ static bool data_ready = false;
double d0 = iCustom(_Symbol, PERIOD_CURRENT, "Myfxbook Outlook Indicator",key,"","","Chart symbol","Lots",0,0);
if(d0 == EMPTY_VALUE) { static bool warned = false; if(!warned) { Print("Waiting for Myfxbook indicator data..."); warned = true; } return(rates_total); }
data_ready = true;
//do something Print("d0:", d0);
return(rates_total);}
I get the error: Myfxbook Outlook Indicator EURUSD,M5: cannot set timer (1)And nothing gets printed, so the call to get the buffer values fails.Can someone please point me in the right direction to the get the lots long and short from the indicator?TIA