DISCLAIMER: Most formulas present in AFL on-line library are submitted
by the users and are provided here on an "as is" and "as available" basis.
AmiBroker.com
makes no representations or warranties of any kind to the contents or the operation
of material presented here. We do not maintain nor provide technical support
for 3rd party formulas. Description:
Awsome Oscilator formula with basic signals as on www.metaquotes.net
Formula:
center=(H+L)/2;
t1=Optimize("t1",34,20,50,3); //slow MA param
t2=Optimize("t2",5,3,10,1); //fast MA param
awi=MA(center,t2)-MA(center,t1);
Plot(awi,"Awsome",IIf(awi>Ref(awi,-1),colorGreen,colorRed),styleHistogram);
Buy=Cover=
Cross(awi,0) OR //cross 0
(awi<0 AND awi>Ref(awi,-1) AND Ref(awi,
-BarsSince(awi<Ref(awi,-1)))>LLV(awi,BarsSince(awi>0))) OR //lower high built
(awi>0 AND awi>Ref(awi,-1)) // awi direction change to positive above 0 level
;
Short=Sell=
Cross(0,awi) OR //cross 0
(awi>0 AND awi<Ref(awi,-1) AND Ref(awi,
-BarsSince(awi>Ref(awi,-1)))<HHV(awi,BarsSince(awi<0))) OR //higher low built
(awi<0 AND awi<Ref(awi,-1)) // awi direction change to negative below 0 level
;
Buy=Cover=ExRem(Buy,Sell);
Sell=Short=ExRem(Short,Cover);
PlotShapes( IIf( Buy, shapeUpArrow , shapeNone ), colorGreen );
PlotShapes( IIf( Short, shapeDownArrow, shapeNone ), colorRed );