Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-15-2007, 12:06 PM
Junior Member
 
Join Date: Apr 2007
Posts: 5
joforex is on a distinguished road
Can someone make this into an EA?

I use this indicator and looks good to trade. Can anybody add buy/sell order commands for an running EA? Thanks

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Sienna
#property indicator_color2 DeepSkyBlue
#property indicator_color3 Gold

//---- input parameters
extern int periodAMA=9;
extern int nfast=2;
extern int nslow=30;
extern double G=2.0;
extern double dK=2.0;

//---- buffers
double kAMAbuffer[];
double kAMAupsig[];
double kAMAdownsig[];

//+------------------------------------------------------------------+

int cbars=0, prevbars=0, prevtime=0;

double slowSC,fastSC;

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE,0,2);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,159);
SetIndexStyle(2,DRAW_ARROW);
SetIndexArrow(2,159);
//SetIndexDrawBegin(0,nslow+nfast);
SetIndexBuffer(0,kAMAbuffer);
SetIndexBuffer(1,kAMAupsig);
SetIndexBuffer(2,kAMAdownsig);


IndicatorDigits(4);

//slowSC=0.064516;
//fastSC=0.2;
//cbars=IndicatorCounted();
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i,pos=0;
double noise=0.000000001,AMA,AMA0,signal,ER;
double dSC,ERSC,SSC,ddK;

if (prevbars==Bars) return(0);

//---- TODO: add your code here
slowSC=(2.0 /(nslow+1));
fastSC=(2.0 /(nfast+1));
cbars=IndicatorCounted();
if (Bars<=(periodAMA+2)) return(0);
//---- check for possible errors
if (cbars<0) return(-1);
//---- last counted bar will be recounted
if (cbars>0) cbars--;
pos=Bars-periodAMA-2;
AMA0=Close[pos+1];
while (pos>=0)
{
if(pos==Bars-periodAMA-2) AMA0=Close[pos+1];
signal=MathAbs(Close[pos]-Close[pos+periodAMA]);
noise=0.000000001;
for(i=0;i<periodAMA;i++)
{
noise=noise+MathAbs(Close[pos+i]-Close[pos+i+1]);
}
ER =signal/noise;
dSC=(fastSC-slowSC);
ERSC=ER*dSC;
SSC=ERSC+slowSC;
AMA=AMA0+(MathPow(SSC,G)*(Close[pos]-AMA0));
kAMAbuffer[pos]=AMA;

ddK=(AMA-AMA0);
if ((MathAbs(ddK)) > (dK*Point) && (ddK > 0)) kAMAupsig[pos] =AMA; else kAMAupsig[pos]=0;
if ((MathAbs(ddK)) > (dK*Point) && (ddK < 0)) kAMAdownsig[pos]=AMA; else kAMAdownsig[pos]=0;


AMA0=AMA;
pos--;
}
//----
prevbars=Bars;
return(0);
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 05-15-2007, 01:17 PM
Senior Member
 
Join Date: May 2006
Posts: 123
gbolla is on a distinguished road
Can you explain how it works?
Thx

Bolla
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-15-2007, 09:13 PM
Junior Member
 
Join Date: Apr 2007
Posts: 5
joforex is on a distinguished road
AMA Indicator

There is a .gif of the indicator on the screen i use. Each dot is a short/long postion you follow as long id does not print the other way. You close the position and reverse following the dots.
Attached Images
File Type: gif gbpm15.gif (58.3 KB, 109 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-16-2007, 01:29 PM
Administrator
 
Join Date: Sep 2005
Posts: 15,942
Blog Entries: 64
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Quote:
Originally Posted by joforex
There is a .gif of the indicator on the screen i use. Each dot is a short/long postion you follow as long id does not print the other way. You close the position and reverse following the dots.
You need to change something with your rules.
Because your rules does not work.

I just attach indicvaor to the chart and backtested slighly for one day.
I did not count the spread.

-224 pips loss. Just for one day.

ama.gif
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-16-2007, 01:35 PM
Administrator
 
Join Date: Sep 2005
Posts: 15,942
Blog Entries: 64
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Well.
You may say that you did not count big move.
Big movement in this indicator is not so profitable according to your rules.

As this indicator is having "ability" to collect more than -200 pips in loss just for one day in flat market so can you imagine which big movement should be to cover this loss?

I counted big movement as well.
-15 pips in loss.
One day as well.

So, in very good day we may lose -10 or -20 pips only.
In flat or ranging market ("bad days")- more than -200 pips losing.
"Very good day" is not every day. It may be once per week, or once per 2 weeks. "Bad days" is every day.

ama1.gif
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you make this? kaztraz Expert Advisors - Metatrader 4 1 11-28-2006 07:49 AM
How can we make an EA babarmughal Expert Advisors - Metatrader 4 2 11-19-2006 12:45 AM
Now You Can Make Your Ea!!!! creative Metatrader 4 1 06-07-2006 02:52 PM


All times are GMT. The time now is 06:54 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.