How to code? - page 209

 

Hi all...

can someone show me how to start coding indicators and EA

 
kessing:
Hi all... can someone show me how to start coding indicators and EA

Hi,

Look here: https://www.mql5.com/en/forum/172969/page2

 
kessing:
Hi all... can someone show me how to start coding indicators and EA

Read this thread (first post): https://www.mql5.com/en/forum/178706

and this thread: https://www.mql5.com/en/forum/173290

 
kessing:
Hi all... can someone show me how to start coding indicators and EA

There's plenty of information both here and over at FF. You can also do a search on Google.

For an easy introduction to EA programming check out the link in my sig. It's a good place to start for a novice programmer.

Good luck!

Lux

 
 

Indicator to EA

Hallo everyone,

I would like to ask for help from anybody who can make the EA out of the Waddah Attar Explosion attached.

Look forward to hearing the response.

Thank you.

-s-

 

ea universal Ma 2 cross

Hy folks!

i'm searching to modify this firedave's ea (from this forum)

the ea is calling "universal ma cross ea"

what i want create is an ea that enter on 2 cross confirmed (for example a couple of ema 2 & 4 and another couple of ema 5 & 20)

this is the main code, what i supposed to do ?

//----------------------- SET VALUE FOR VARIABLE

if(ConfirmedOnEntry==true)

{

if(CheckTime==iTime(NULL,TimeFrame,0)) return(0); else CheckTime = iTime(NULL,TimeFrame,0);

FastMACurrent = iMA(NULL,TimeFrame,FastMAPeriod,FastMAshift,FastMAType,FastMAPrice,1);

SlowMACurrent = iMA(NULL,TimeFrame,SlowMAPeriod,SlowMAshift,SlowMAType,SlowMAPrice,1);

}

else

{

FastMACurrent = iMA(NULL,TimeFrame,FastMAPeriod,FastMAshift,FastMAType,FastMAPrice,0);

SlowMACurrent = iMA(NULL,TimeFrame,SlowMAPeriod,SlowMAshift,SlowMAType,SlowMAPrice,0);

}

CrossDirection = subCrossDirection(FastMACurrent,SlowMACurrent);

i had try everything, but i don't find a solution...please help me for the health of this community , i want something similar to this :

//----------------------- SET VALUE FOR VARIABLE

if(ConfirmedOnEntry==true)

{

if(CheckTime==iTime(NULL,TimeFrame,0)) return(0); else CheckTime = iTime(NULL,TimeFrame,0);

FastMACurrent = iMA(NULL,TimeFrame,2,FastMAshift,FastMAType,FastMAPrice,1);

SlowMACurrent = iMA(NULL,TimeFrame,4,SlowMAshift,SlowMAType,SlowMAPrice,1);

FastMACurrent2 = iMA(NULL,TimeFrame,5,FastMAshift,FastMAType,FastMAPrice,1);

SlowMACurrent2 = iMA(NULL,TimeFrame,20,SlowMAshift,SlowMAType,SlowMAPrice,1);

}

else

{

FastMACurrent = iMA(NULL,TimeFrame,2,FastMAshift,FastMAType,FastMAPrice,0);

SlowMACurrent = iMA(NULL,TimeFrame,4,SlowMAshift,SlowMAType,SlowMAPrice,0);

FastMACurrent2 = iMA(NULL,TimeFrame,5,FastMAshift,FastMAType,FastMAPrice,0);

SlowMACurrent2 = iMA(NULL,TimeFrame,20,SlowMAshift,SlowMAType,SlowMAPrice,0);

}

CrossDirection = subCrossDirection(FastMACurrent,SlowMACurrent && FastMACurrent2,SlowMACurrent2);

Files:
 

Whats wrong with my indicator? Error Message

Hi,

here is the code from my indicator:

#property indicator_separate_window

#property indicator_buffers 2

#property indicator_color1 LightSeaGreen

#property indicator_color2 Blue

extern string Timeframe_Momentum = "PERIOD_H1";

extern int Periode_Momentum = 500;

extern int Periode_MA_Momentum = 8;

double Buffer_Mom[];

double Buffer_Ma[];

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_LINE);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(0,Buffer_Mom);

SetIndexBuffer(1,Buffer_Ma);

//----

SetIndexEmptyValue(0,0.0);

SetIndexEmptyValue(1,0.0);

SetIndexDrawBegin(0,100);

SetIndexDrawBegin(1,100);

//----

return(0);

}

int deinit()

{

//----

return(0);

}

void start()

{

int counted_bars=IndicatorCounted();

int limit=Bars-counted_bars;

if(counted_bars>0) limit++;

//----

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

{

Buffer_Mom=iMomentum(NULL,Timeframe_Momentum,Periode_Momentum,PRICE_CLOSE,i);

Buffer_Ma=iMAOnArray(Buffer_Mom,0,Periode_MA_Momentum,0,MODE_SMA,i);

}

return(0);

}

Here is the code I use in the main Programm:

double GMI1 = iCustom(NULL,0,"GMI",Timeframe_Momentum,Periode_Momentum,Periode_MA_Momentum, 0,1);

double GMI2 = iCustom(NULL,0,"GMI",Timeframe_Momentum,Periode_Momentum,Periode_MA_Momentum, 1,2);

Now my problems:

I get this error message: EURUSD,M5: invalid integer number as parameter 2 for Indicator call function

AND there is no Buffer_Ma in my chart! What is wrong with my code?!

 

Hello

How do you calculate the Standard Deviation Between the Open and High of the previous bar?

Any help would be great.

Cheers

Beno

 

PERIOD_H1 is an interger macro try changing that line to

extern int TimeFrame_Momentum = PERIOD_H1;

or just replace PERIOD_H1 with 60 and try that

sunshineh:
Hi,

here is the code from my indicator:

#property indicator_separate_window

#property indicator_buffers 2

#property indicator_color1 LightSeaGreen

#property indicator_color2 Blue

extern string Timeframe_Momentum = "PERIOD_H1";

extern int Periode_Momentum = 500;

extern int Periode_MA_Momentum = 8;

double Buffer_Mom[];

double Buffer_Ma[];

int init()

{

//---- indicators

SetIndexStyle(0,DRAW_LINE);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(0,Buffer_Mom);

SetIndexBuffer(1,Buffer_Ma);

//----

SetIndexEmptyValue(0,0.0);

SetIndexEmptyValue(1,0.0);

SetIndexDrawBegin(0,100);

SetIndexDrawBegin(1,100);

//----

return(0);

}

int deinit()

{

//----

return(0);

}

void start()

{

int counted_bars=IndicatorCounted();

int limit=Bars-counted_bars;

if(counted_bars>0) limit++;

//----

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

{

Buffer_Mom=iMomentum(NULL,Timeframe_Momentum,Periode_Momentum,PRICE_CLOSE,i);

Buffer_Ma=iMAOnArray(Buffer_Mom,0,Periode_MA_Momentum,0,MODE_SMA,i);

}

return(0);

}

Here is the code I use in the main Programm:

double GMI1 = iCustom(NULL,0,"GMI",Timeframe_Momentum,Periode_Momentum,Periode_MA_Momentum, 0,1);

double GMI2 = iCustom(NULL,0,"GMI",Timeframe_Momentum,Periode_Momentum,Periode_MA_Momentum, 1,2);

Now my problems:

I get this error message: EURUSD,M5: invalid integer number as parameter 2 for Indicator call function

AND there is no Buffer_Ma in my chart! What is wrong with my code?!
Reason: