Download MetaTrader 5

How to convert indicator codes to EA?

To add comments, please log in or register
ronaldosim
18
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_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

Nadeem
1864
Nadeem  
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.
Sony Irwana
28
Sony Irwana  

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

dovgr
5
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);

matrixebiz
1733
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

adjiee84
3
adjiee84  
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..

test9x
13
test9x  

Thanks

sammubravo
126
sammubravo  

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

Shahzad
7
Shahzad  
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?

martin eshleman
295
martin eshleman  
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.

To add comments, please log in or register