How to convert indicator codes to EA?

 

Hi

I want to convert an indicator to an EA. This is taken from the mql4 Help example on the function IndicatorCounted(). What do one do with the variables counted_bars and limit in an EA?

thks

int start()

{

int limit;

int counted_bars=IndicatorCounted(); //---- check for possible errors

if(counted_bars<0) return(-1); //---- the last counted bar will be recounted

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars; //---- main loop

for(int i=0; i<limit; i++)

{ //---- ma_shift set to 0 because

SetIndexShift called abowe

ExtBlueBuffer=iMA(NULL,0,JawsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
ExtRedBuffer=iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
ExtLimeBuffer=iMA(NULL,0,LipsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
} //---- done
return(0);
}

ronaldo

 
ronaldosim:
Hi I want to convert an indicator to an EA. This is taken from the mql4 Help example on the function IndicatorCounted(). What do one do with the variables counted_bars and limit in an EA? thks int start() { int limit; int counted_bars=IndicatorCounted(); //---- check for possible errors if(counted_bars0) counted_bars--; limit=Bars-counted_bars; //---- main loop for(int i=0; i<limit; i++) { //---- ma_shift set to 0 because SetIndexShift called abowe ExtBlueBuffer=iMA(NULL,0,JawsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
ExtRedBuffer=iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
ExtLimeBuffer=iMA(NULL,0,LipsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i);
} //---- done
return(0);
}

ronaldo
This code is for indicator, you cant convert indicator directly to EA. You have to build the indicator then call it from the EA.
 

how to convert ex4 become mq4 files? reply to sonyirwana2006 yahoo messengger please

 

Basically its very simple - you don't need to change the indicator code.

You can use the iCustom function in order to get the indicator array value for each new tick. Look for the mql help on this function.

double val=iCustom(NULL, 0, "SampleInd",13,1,0);

 

How do you add indicator code to an EA so I get indicator and EA all in one so I don't need to do iCustom calls?

Thanks

 
dovgr:
Basically its very simple - you don't need to change the indicator code.You can use the iCustom function in order to get the indicator array value for each new tick. Look for the mql help on this function. double val=iCustom(NULL, 0, "SampleInd",13,1,0);

hi...i have to use double val=iCustom(NULL, 0, "myindi",13,1,0);

but still dont work...

the result always zero (0)....

pls help..

 

Thanks

 

any one can convert my mt4 indicator to ea hereby i have attach that indicator and i am ready to pay for that

 
dovgr:
Basically its very simple - you don't need to change the indicator code. You can use the iCustom function in order to get the indicator array value for each new tick. Look for the mql help on this function. double val=iCustom(NULL, 0, "SampleInd",13,1,0);

Dear i am trying to make EA of Harmonic pattern indicator "Zup 117 NEN STAR", but not able to get correct BUY and SELL signal parameters through icustom. can you please help me to do it?

 
matrixebiz:
How do you add indicator code to an EA so I get indicator and EA all in one so I don't need to do iCustom calls? Thanks

This is possible to do but it is not simple. Also, each different job would be unique since each indicator is different. So this question cannot be answered with any clarity.