Skip to main content

Simple WMA 100 for Amibroker (AFL)

yustinus almost 15 years ago Amibroker (AFL)

  • Rating:
    4 / 5 (Votes 3)
  • Tags:
    trading system, amibroker

Buy & Sell when price cross WMA 100

Indicator / Formula

Copy & Paste Friendly
Short = 0;
Cover = 0;

/*Buy = C > WMA(C,100)
	AND Cross(C,EMA(C,100));

Sell = C < WMA(C,100)
	AND Cross(C,EMA(C,100));*/

/*Buy = WMA(C,50) > WMA(C,100)
	AND	Ref(WMA(C,50),-1) < Ref(WMA(C,100),-1);

Sell = WMA(C,50) < WMA(C,100)
	AND	Ref(WMA(C,50),-1) > Ref(WMA(C,100),-1);
*/

//Buy=ExRem(Buy,Sell);
//Sell = ExRem(Sell,Buy);

Buy = C > WMA(C,100)
	AND Ref(C,-1) < Ref(WMA(C,100),-1);

Sell = C <= WMA(C,100)
	AND Ref(C,-1) > Ref(WMA(C,100),-1);

Buy=ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);

PlotShapes(shapeUpArrow*Buy,colorBrightGreen);
PlotShapes(shapeDownArrow*Sell,colorRed);

2 comments

almost 15 years ago

Thanks for the post. I’ve been trying to script an EA which has the Price crossing the WMA 50 with an OCO trade (one cancels other). So as soon as the current trade closes another trade opens in the opposite direction. There would always be one active trade and the cycle would continue indefinitely. Any thoughts on what that script might look like? I’ve been trying to research it but with not much success.

Any insight is appreciated!

Leave Comment

Please login here to leave a comment.