Will create your Expert Advisor for Free! - page 18

 

Are you still coding EA's? If so I think this one would be easy and effective. The NonLagMa v.7 is an indicator that is similar to the Sanefx template. When the indicator changes color the EA would open a trade, as soon as the color changes it would close the position and immediatley open a trade in the opposite direction. Simple but effective!! Below is the mq4.

Thanks for taking a look!!!

Jim

//+------------------------------------------------------------------+
//| NonLagMA_v7.1.mq4 |
//| Copyright © 2007, TrendLaboratory |
//| http://finance.groups.yahoo.com/group/TrendLaboratory |
//| E-mail: igorad2003@yahoo.co.uk |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, TrendLaboratory"
#property link "http://finance.groups.yahoo.com/group/TrendLaboratory"


#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Orange
#property indicator_width1 2
#property indicator_color2 Aqua
#property indicator_width2 2
#property indicator_color3 Magenta
#property indicator_width3 2


//---- input parameters
extern int Price = 0; //Apply to Price(0-Close;1-Open;2-High;3-Low;4-Median price;5-Typical price;6-Weighted Close)
extern int Length = 15; //Period of NonLagMA
extern int Displace = 0; //DispLace or Shift
extern double PctFilter = 0; //Dynamic filter in decimal
extern int Color = 1; //Switch of Color mode (1-color)
extern int ColorBarBack = 1; //Bar back for color mode
extern double Deviation = 0; //Up/down deviation
extern int AlertMode = 0; //Sound Alert switch (0-off,1-on)
extern int WarningMode = 0; //Sound Warning switch(0-off,1-on)
//---- indicator buffers
double MABuffer[];
double UpBuffer[];
double DnBuffer[];
double trend[];
double Del[];
double AvgDel[];

double alfa[];
int i, Phase, Len,Cycle=4;
double Coeff, beta, t, Sum, Weight, g;
double pi = 3.1415926535;
bool UpTrendAlert=false, DownTrendAlert=false;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(6);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,MABuffer);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,UpBuffer);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,DnBuffer);
SetIndexBuffer(3,trend);
SetIndexBuffer(4,Del);
SetIndexBuffer(5,AvgDel);
string short_name;
//---- indicator line

IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
//---- name for DataWindow and indicator subwindow label
short_name="NonLagMA("+Length+")";
IndicatorShortName(short_name);
SetIndexLabel(0,"NonLagMA");
SetIndexLabel(1,"Up");
SetIndexLabel(2,"Dn");
//----
SetIndexShift(0,Displace);
SetIndexShift(1,Displace);
SetIndexShift(2,Displace);

SetIndexEmptyValue(0,EMPTY_VALUE);
SetIndexEmptyValue(1,EMPTY_VALUE);
SetIndexEmptyValue(2,EMPTY_VALUE);

SetIndexDrawBegin(0,Length*Cycle+Length+1);
SetIndexDrawBegin(1,Length*Cycle+Length+1);
SetIndexDrawBegin(2,Length*Cycle+Length+1);
//----

Coeff = 3*pi;
Phase = Length-1;
Len = Length*4 + Phase;
ArrayResize(alfa,Len);
Weight=0;

for (i=0;i<Len-1;i++)
{
if (i<=Phase-1) t = 1.0*i/(Phase-1);
else t = 1.0 + (i-Phase+1)*(2.0*Cycle-1.0)/(Cycle*Length-1.0);
beta = MathCos(pi*t);
g = 1.0/(Coeff*t+1);
if (t <= 0.5 ) g = 1;
alfa[i] = g * beta;
Weight += alfa[i];
}

return(0);
}

//+------------------------------------------------------------------+
//| NonLagMA_v7.1 |
//+------------------------------------------------------------------+
int start()
{
int i,shift, counted_bars=IndicatorCounted(),limit;
double price;
if ( counted_bars > 0 ) limit=Bars-counted_bars;
if ( counted_bars < 0 ) return(0);
if ( counted_bars ==0 ) limit=Bars-Len-1;
if ( counted_bars < 1 )

for(i=1;i<Length*Cycle+Length;i++)
{
MABuffer[Bars-i]=0;
UpBuffer[Bars-i]=0;
DnBuffer[Bars-i]=0;
}

for(shift=limit;shift>=0;shift--)
{
Sum = 0;
for (i=0;i<=Len-1;i++)
{
price = iMA(NULL,0,1,0,3,Price,i+shift);
Sum += alfa[i]*price;

}

if (Weight > 0) MABuffer[shift] = (1.0+Deviation/100)*Sum/Weight;


if (PctFilter>0)
{
Del[shift] = MathAbs(MABuffer[shift] - MABuffer[shift+1]);

double sumdel=0;
for (i=0;i<=Length-1;i++) sumdel = sumdel+Del[shift+i];
AvgDel[shift] = sumdel/Length;

double sumpow = 0;
for (i=0;i<=Length-1;i++) sumpow+=MathPow(Del[shift+i]-AvgDel[shift+i],2);
double StdDev = MathSqrt(sumpow/Length);

double Filter = PctFilter * StdDev;

if( MathAbs(MABuffer[shift]-MABuffer[shift+1]) < Filter ) MABuffer[shift]=MABuffer[shift+1];
}
else
Filter=0;

if (Color>0)
{
trend[shift]=trend[shift+1];
if (MABuffer[shift]-MABuffer[shift+1] > Filter) trend[shift]= 1;
if (MABuffer[shift+1]-MABuffer[shift] > Filter) trend[shift]=-1;
if (trend[shift]>0)
{
UpBuffer[shift] = MABuffer[shift];
if (trend[shift+ColorBarBack]<0) UpBuffer[shift+ColorBarBack]=MABuffer[shift+ColorBarBack];
DnBuffer[shift] = EMPTY_VALUE;
if (WarningMode>0 && trend[shift+1]<0 && shift==0) PlaySound("alert2.wav");
}
if (trend[shift]<0)
{
DnBuffer[shift] = MABuffer[shift];
if (trend[shift+ColorBarBack]>0) DnBuffer[shift+ColorBarBack]=MABuffer[shift+ColorBarBack];
UpBuffer[shift] = EMPTY_VALUE;
if (WarningMode>0 && trend[shift+1]>0 && shift==0) PlaySound("alert2.wav");
}
}
}
//----------
string Message;

if ( trend[2]<0 && trend[1]>0 && Volume[0]>1 && !UpTrendAlert)
{
Message = " NonLagMA "+Symbol()+" M"+Period()+": Signal for BUY";
if ( AlertMode>0 ) Alert (Message);
UpTrendAlert=true; DownTrendAlert=false;
}

if ( trend[2]>0 && trend[1]<0 && Volume[0]>1 && !DownTrendAlert)
{
Message = " NonLagMA "+Symbol()+" M"+Period()+": Signal for SELL";
if ( AlertMode>0 ) Alert (Message);
DownTrendAlert=true; UpTrendAlert=false;
}
//----
return(0);
}
Files:
 
Redland:

Are you still coding EA's? If so I think this one would be easy and effective. The NonLagMa v.7 is an indicator that is similar to the Sanefx template. When the indicator changes color the EA would open a trade, as soon as the color changes it would close the position and immediatley open a trade in the opposite direction. Simple but effective!! Below is the mq4.

Thanks for taking a look!!!

Jim

//+------------------------------------------------------------------+
//| NonLagMA_v7.1.mq4 |
//| Copyright © 2007, TrendLaboratory |
//| http://finance.groups.yahoo.com/group/TrendLaboratory |
//| E-mail: igorad2003@yahoo.co.uk |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, TrendLaboratory"
#property link "http://finance.groups.yahoo.com/group/TrendLaboratory&quot;


#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Orange
#property indicator_width1 2
#property indicator_color2 Aqua
#property indicator_width2 2
#property indicator_color3 Magenta
#property indicator_width3 2


//---- input parameters
extern int Price = 0; //Apply to Price(0-Close;1-Open;2-High;3-Low;4-Median price;5-Typical price;6-Weighted Close)
extern int Length = 15; //Period of NonLagMA
extern int Displace = 0; //DispLace or Shift
extern double PctFilter = 0; //Dynamic filter in decimal
extern int Color = 1; //Switch of Color mode (1-color)
extern int ColorBarBack = 1; //Bar back for color mode
extern double Deviation = 0; //Up/down deviation
extern int AlertMode = 0; //Sound Alert switch (0-off,1-on)
extern int WarningMode = 0; //Sound Warning switch(0-off,1-on)
//---- indicator buffers
double MABuffer[];
double UpBuffer[];
double DnBuffer[];
double trend[];
double Del[];
double AvgDel[];

double alfa[];
int i, Phase, Len,Cycle=4;
double Coeff, beta, t, Sum, Weight, g;
double pi = 3.1415926535;
bool UpTrendAlert=false, DownTrendAlert=false;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(6);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,MABuffer);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,UpBuffer);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,DnBuffer);
SetIndexBuffer(3,trend);
SetIndexBuffer(4,Del);
SetIndexBuffer(5,AvgDel);
string short_name;
//---- indicator line

IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
//---- name for DataWindow and indicator subwindow label
short_name="NonLagMA("+Length+")";
IndicatorShortName(short_name);
SetIndexLabel(0,"NonLagMA");
SetIndexLabel(1,"Up");
SetIndexLabel(2,"Dn");
//----
SetIndexShift(0,Displace);
SetIndexShift(1,Displace);
SetIndexShift(2,Displace);

SetIndexEmptyValue(0,EMPTY_VALUE);
SetIndexEmptyValue(1,EMPTY_VALUE);
SetIndexEmptyValue(2,EMPTY_VALUE);

SetIndexDrawBegin(0,Length*Cycle+Length+1);
SetIndexDrawBegin(1,Length*Cycle+Length+1);
SetIndexDrawBegin(2,Length*Cycle+Length+1);
//----

Coeff = 3*pi;
Phase = Length-1;
Len = Length*4 + Phase;
ArrayResize(alfa,Len);
Weight=0;

for (i=0;i<Len-1;i++)
{
if (i<=Phase-1) t = 1.0*i/(Phase-1);
else t = 1.0 + (i-Phase+1)*(2.0*Cycle-1.0)/(Cycle*Length-1.0);
beta = MathCos(pi*t);
g = 1.0/(Coeff*t+1);
if (t <= 0.5 ) g = 1;
alfa[i] = g * beta;
Weight += alfa[i];
}

return(0);
}

//+------------------------------------------------------------------+
//| NonLagMA_v7.1 |
//+------------------------------------------------------------------+
int start()
{
int i,shift, counted_bars=IndicatorCounted(),limit;
double price;
if ( counted_bars > 0 ) limit=Bars-counted_bars;
if ( counted_bars < 0 ) return(0);
if ( counted_bars ==0 ) limit=Bars-Len-1;
if ( counted_bars < 1 )

for(i=1;i<Length*Cycle+Length;i++)
{
MABuffer[Bars-i]=0;
UpBuffer[Bars-i]=0;
DnBuffer[Bars-i]=0;
}

for(shift=limit;shift>=0;shift--)
{
Sum = 0;
for (i=0;i<=Len-1;i++)
{
price = iMA(NULL,0,1,0,3,Price,i+shift);
Sum += alfa[i]*price;

}

if (Weight > 0) MABuffer[shift] = (1.0+Deviation/100)*Sum/Weight;


if (PctFilter>0)
{
Del[shift] = MathAbs(MABuffer[shift] - MABuffer[shift+1]);

double sumdel=0;
for (i=0;i<=Length-1;i++) sumdel = sumdel+Del[shift+i];
AvgDel[shift] = sumdel/Length;

double sumpow = 0;
for (i=0;i<=Length-1;i++) sumpow+=MathPow(Del[shift+i]-AvgDel[shift+i],2);
double StdDev = MathSqrt(sumpow/Length);

double Filter = PctFilter * StdDev;

if( MathAbs(MABuffer[shift]-MABuffer[shift+1]) < Filter ) MABuffer[shift]=MABuffer[shift+1];
}
else
Filter=0;

if (Color>0)
{
trend[shift]=trend[shift+1];
if (MABuffer[shift]-MABuffer[shift+1] > Filter) trend[shift]= 1;
if (MABuffer[shift+1]-MABuffer[shift] > Filter) trend[shift]=-1;
if (trend[shift]>0)
{
UpBuffer[shift] = MABuffer[shift];
if (trend[shift+ColorBarBack]<0) UpBuffer[shift+ColorBarBack]=MABuffer[shift+ColorBarBack];
DnBuffer[shift] = EMPTY_VALUE;
if (WarningMode>0 && trend[shift+1]<0 && shift==0) PlaySound("alert2.wav");
}
if (trend[shift]<0)
{
DnBuffer[shift] = MABuffer[shift];
if (trend[shift+ColorBarBack]>0) DnBuffer[shift+ColorBarBack]=MABuffer[shift+ColorBarBack];
UpBuffer[shift] = EMPTY_VALUE;
if (WarningMode>0 && trend[shift+1]>0 && shift==0) PlaySound("alert2.wav");
}
}
}
//----------
string Message;

if ( trend[2]<0 && trend[1]>0 && Volume[0]>1 && !UpTrendAlert)
{
Message = " NonLagMA "+Symbol()+" M"+Period()+": Signal for BUY";
if ( AlertMode>0 ) Alert (Message);
UpTrendAlert=true; DownTrendAlert=false;
}

if ( trend[2]>0 && trend[1]<0 && Volume[0]>1 && !DownTrendAlert)
{
Message = " NonLagMA "+Symbol()+" M"+Period()+": Signal for SELL";
if ( AlertMode>0 ) Alert (Message);
DownTrendAlert=true; UpTrendAlert=false;
}
//----
return(0);
}

Hi Jim


A fascinating indicator. I think I know just enough to make an EA from it ;}


I will keep you posted, thanks for sharing.

 
Hi would you please work on that attached EA to make it work. I can't figure out the variable to go the error away. Also maybe you can add another ma that if when crosses and the Heiken primary trade indicator changes it stays in. Like as filter. And maybe it also would work with Heiken with two separate heiken crosses to filter the trade. I noticed if Heiken with different settings work like ma and filter the trade.
Files:
alliheik_1.mq4  17 kb
 
Ajarn.Chan:

Hi Jim


A fascinating indicator. I think I know just enough to make an EA from it ;}


I will keep you posted, thanks for sharing.

 

That is awesome! I will be looking forward to it. I also have the manual for the indicator. If you send me a private email address I will send it to you. I think it would be very beneficial. I wish I could write these EA's.

Jim

 
vriesde1:
Hi Guys,

I am a Computer Science student heading towards my masters, and very interested in Forex.

Basically, I offer to create a free Expert Advisor for whoever needs one. I just finished my own first Expert Advisor, it gave me a return of 100% over 2007-2008, but performs less good @ the years before 2007, some not even profitable. Therefor Im looking for more inspiration!

I am doing this for extra experience in both mq4 and forex trading systems themselves.

Oh and by the way, I am already working on the inside bar expert so do not come up with that one :D.

Send me a private message with your plan, and you can expect, if the EA is not too complicated, within one week.

Greetings!!

Hello. If you are still creating expert advisors please let me know.my strategy  is very simple please email me at  forexgls@yahoo.com thank you.

 
vriesde1 wrote >>
Hi Guys,

I am a Computer Science student heading towards my masters, and very interested in Forex.

Basically, I offer to create a free Expert Advisor for whoever needs one. I just finished my own first Expert Advisor, it gave me a return of 100% over 2007-2008, but performs less good @ the years before 2007, some not even profitable. Therefor Im looking for more inspiration!

I am doing this for extra experience in both mq4 and forex trading systems themselves.

Oh and by the way, I am already working on the inside bar expert so do not come up with that one :D.

Send me a private message with your plan, and you can expect, if the EA is not too complicated, within one week.

Greetings!!

If you are still coding please contact me at dvesledahl@comcast.net. I have what should be a somewhat simple request.

Thanks! Doug

 
vriesde1 wrote >>
Hi Guys,

I am a Computer Science student heading towards my masters, and very interested in Forex.

Basically, I offer to create a free Expert Advisor for whoever needs one. I just finished my own first Expert Advisor, it gave me a return of 100% over 2007-2008, but performs less good @ the years before 2007, some not even profitable. Therefor Im looking for more inspiration!

I am doing this for extra experience in both mq4 and forex trading systems themselves.

Oh and by the way, I am already working on the inside bar expert so do not come up with that one :D.

Send me a private message with your plan, and you can expect, if the EA is not too complicated, within one week.

Greetings!!

Hi, I am Cody, me and a newly founded friend, are both looking for the same simple system. If you could help, you would be a lifesaver. We are both somewhat new. Every thing is explained in the post 'DAILY BREAKOUT EA , PLEAS E HELP MY SYSTEM'. My email is all1truth@gmal.com. Please email or post a reply either way, so I know if I need to keep checking back. Thank you so much

 

all1truth and others,

I think vriesde not doing any free service anymore

better request elsewhere

 
fgiovanardi:

Dear Vriesde1,

I have been trading futures for many years using techical indicators, I have a few strategies that seem to be working fine, unfortunally I have no experience in writing programs and Expert Advisors, I desperately need some help from you!! My strategies work on simple indicators, nothing complicated or exotic...

Please get in touch, fgiovanardi@yahoo.com

Thank you. Franco

hello,


i have been trading forex for 4 years now with only a simple simple system,


i will like you to contact me at mrafolabiplaza@yahoo.com


i want to convert my strategy to EA.


THANKS

Reason: