How to convert indicator codes to EA?
  #1 (permalink)  
Old 09-22-2007, 08:35 AM
Forex Trader
 
Join Date: Jul 2007
Posts: 6
ronaldosim is on a distinguished road
Default 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[i]=iMA(NULL,0,JawsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i) ;
ExtRedBuffer[i]=iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i );
ExtLimeBuffer[i]=iMA(NULL,0,LipsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i) ;
} //---- done
return(0);
}

ronaldo
Reply With Quote
  #2 (permalink)  
Old 09-22-2007, 04:45 PM
bossxero's Avatar
Honorary Moderator
 
Join Date: Nov 2006
Location: Neverland
Posts: 851
bossxero has a spectacular aura aboutbossxero has a spectacular aura aboutbossxero has a spectacular aura about
Send a message via ICQ to bossxero Send a message via MSN to bossxero Send a message via Yahoo to bossxero Send a message via Skype™ to bossxero
Default

Quote:
Originally Posted by ronaldosim View Post
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[i]=iMA(NULL,0,JawsPeriod,0,MODE_SMMA,PRICE_MEDIAN,i) ;
ExtRedBuffer[i]=iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i );
ExtLimeBuffer[i]=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.
Reply With Quote
  #3 (permalink)  
Old 12-01-2007, 12:36 PM
Forex Trader
 
Join Date: May 2007
Posts: 11
sonyirwana is on a distinguished road
Send a message via Yahoo to sonyirwana
Default

how to convert ex4 become mq4 files? reply to sonyirwana2006 yahoo messengger please
Reply With Quote
use the iCustom function
  #4 (permalink)  
Old 12-03-2007, 09:12 AM
Currency Trader
 
Join Date: Oct 2007
Posts: 3
dovgr is on a distinguished road
Default use the iCustom function

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);
Reply With Quote
  #5 (permalink)  
Old 07-24-2008, 04:14 PM
Forex Trader
 
Join Date: Nov 2006
Posts: 22
matrixebiz is on a distinguished road
Default

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
Reply With Quote
  #6 (permalink)  
Old 02-01-2009, 07:54 AM
Currency Trader
 
Join Date: Dec 2008
Posts: 1
adjiee84 is on a distinguished road
Default

Quote:
Originally Posted by dovgr View Post
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..
Reply With Quote
  #7 (permalink)  
Old 04-10-2010, 01:59 PM
Currency Trader
 
Join Date: May 2009
Posts: 2
test9x is on a distinguished road
Default

Thanks
Reply With Quote
  #8 (permalink)  
Old 07-13-2012, 01:23 PM
Currency Trader
 
Join Date: Jul 2012
Posts: 1
sammubravo is on a distinguished road
Default

any one can convert my mt4 indicator to ea hereby i have attach that indicator and i am ready to pay for that
Reply With Quote
  #9 (permalink)  
Old 03-20-2013, 09:03 PM
Currency Trader
 
Join Date: Feb 2012
Posts: 1
shahzadahsan is on a distinguished road
Default

Quote:
Originally Posted by dovgr View Post
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?
Reply With Quote
  #10 (permalink)  
Old 03-21-2013, 03:03 PM
Forex Warrior
 
Join Date: May 2010
Posts: 251
master4x is on a distinguished road
Default

Quote:
Originally Posted by matrixebiz View Post
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.
Mizan likes this.
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert gmt to eastern, am or pm? forex9 General Trading Talk 2 07-12-2007 12:34 AM
Scorpion Need Help Convert EA Please txsundevil Trading Systems 2 09-28-2006 07:18 PM


All times are GMT. The time now is 03:57 PM.

Registered members gain free access to online FOREX currency trading tools, foreign exchange software, Metatrader MT4/MT5 expert advisors, MT4 indicators and EAs. Register now