Please could anybody help in inserting buy-sell signals in the Gann HiLo formula?

#1
Hi,

Please could anybody help in inserting buy-sell signals in the below Gann HiLo formula?

Also wish to have this formula back tested.


/*Gann HiLo*/

Hld = IIf(C > Ref(MA(H, 3), -1), 1, IIf(C < Ref(MA(L, 3), -1), -1, 0));
Hlv = ValueWhen(Hld != 0, Hld, 1);
Hilo = IIf(Hlv == -1, MA(H, 3), MA(L, 3));
Trigger = IIf(C>Hilo, colorGreen, colorRed);
Plot(Hilo,"HiLo",Trigger,styleStaircase);

Thanking you in anticipation.

Regards.
 

yasu222

Active Member
#2
Hi,

Please could anybody help in inserting buy-sell signals in the below Gann HiLo formula?

Also wish to have this formula back tested.


/*Gann HiLo*/

Hld = IIf(C > Ref(MA(H, 3), -1), 1, IIf(C < Ref(MA(L, 3), -1), -1, 0));
Hlv = ValueWhen(Hld != 0, Hld, 1);
Hilo = IIf(Hlv == -1, MA(H, 3), MA(L, 3));
Trigger = IIf(C>Hilo, colorGreen, colorRed);
Plot(Hilo,"HiLo",Trigger,styleStaircase);

Thanking you in anticipation.

Regards.
same request for below code -


_SECTION_BEGIN( "Gann HiLo" );
Lb = Param("Look-Back Periods?",3,2,10,1);
HLd = IIf(Close>Ref(MA(H,Lb),-1),1,IIf(Close<Ref(MA(L,Lb),-1),-1,0));
HLv = ValueWhen(HLd!=0,HLd,1);
HiLo = IIf(HLv==-1,MA(H,Lb),MA(L,Lb));


Trigger = IIf(C>Hilo, colorGreen, colorRed);
Plot(Hilo,"HiLo",Trigger,styleStaircase);
_SECTION_END();

_SECTION_BEGIN("Candles");
BgColor=ParamColor("BgColor", colorBlack);
SetChartBkGradientFill( BgColor,BgColor,BgColor);
upcolor=ParamColor("Up color ",colorGreen);
downcolor=ParamColor("Down color ",colorRed);
barcolor=IIf(C>Ref(C,-1),upcolor,downcolor);
Insidecolor=IIf(C<O,barcolor,BgColor);
SetBarFillColor(Insidecolor);
PlotOHLC( Open, High, Low, Close, " " , barcolor, styleCandle | styleThick );
_SECTION_END();