Download MetaTrader 5

Simple iCustom

To add comments, please log in or register
KingOfSand 2015.05.10 12:41 


I am having some trouble with iCustom. I need to use it for such a simple thing as passing a buy and put signal to an EA.

Can someone show me a simple way to do this?


This is some of the code in the EA:

double CallFromIndicator;
double PutFromIndicator;

CallFromIndicator = iCustom(NULL,0,"IndicatorForEA",1,0);
PutFromIndicator = iCustom(NULL,0,"IndicatorForEA",2,0); 




if(CallFromIndicator == 1)
printf (CallFromIndicator + "Call");

if(PutFromIndicator == 1)
printf (PutFromIndicator + "Put");


 The printf is just for debugging


And here is some code from the indicator:

#property indicator_buffers 1



double PutBuffer[];
double CallBuffer[];




// PUT

if (EverythingAlignsForAput = true){
         PutBuffer[2] = 1;

// CALL 

if (EverythingAlignsForAcall == true){
         CallBuffer[1] = 1;

PutBuffer[2] = 0;
CallBuffer[1] = 0;
whroeder1 2015.05.10 18:30  
  1. #property indicator_buffers 1
    double PutBuffer[];
    double CallBuffer[];
    Can't have two
  2. CallFromIndicator = iCustom(NULL,0,"IndicatorForEA",1,0);
    PutFromIndicator = iCustom(NULL,0,"IndicatorForEA",2,0); 
    If you have SetIndexBuffer(0, PutBuffer); SetIndexBuffer(1, CallBuffer); then your iCustom calls are wrong.
  3. if (EverythingAlignsForAput = true)    PutBuffer[2] = 1;
    if (EverythingAlignsForAcall == true) CallBuffer[1] = 1;
    Why are you setting element 2? Shouldn't the signal be on the current bar or the previous? In either case your iCustom calls are wrong.

  4. Detailed explanation of iCustom - MQL4 forum
KingOfSand 2015.05.14 16:07  

Thanks...  Just new to this as you can understand.


Could you make an example how I can get two different signals from the indicator to the EA?
My brain is totally ****** up probably :) 

KingOfSand 2015.05.18 14:56  
No one can make a good example how to get Call and Put signals from an indicator to an EA? So far I only have got info about things that is wrong.
To add comments, please log in or register