WMA Cross over for Amibroker (AFL)
Ketan-0 over 14 years ago Amibroker (AFL)
Works well in commodity trading specially for MCX
Indicator / Formula
Copy & Paste Friendly
//
//
WMA1 = WMA(C,1);
WMA2 = WMA(C,120);
// the buy and sell logic
// buy when wma1 crosses from below wma2 to above wma2.
Buy = Cross(WMA1,WMA2);
Sell = Cross(WMA2,WMA1);
Short = Sell;
Cover = Buy;
Plot(Close, "price",colorBlue,styleBar);
// plot the wma lines.
Plot(WMA1,"wma1",colorGreen,styleLine);
Plot(WMA2,"wma2",colorBlue,styleLine);
// plot the buy and sell arrows.
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes(shape, IIf(Buy,colorGreen,colorRed), 0,
IIf(Buy,Low,High));
GraphXSpace = 5;
1 comments
Leave Comment
Please login here to leave a comment.
shows error for suitable place for Buy or sell