setting for buy sell arrow

#1
anybody help me please , if price close above the gann(green line) line buy, and if price close below the gann(redline) line and sell with arrow

thanks a lot for advance


/*Gann HiLo*/

Hld = IIf(C > Ref(MA(H, 8), -1), 1, IIf(C < Ref(MA(L, 8), -1), -1, 0));
Hlv = ValueWhen(Hld != 0, Hld, 1);
Hilo = IIf(Hlv == -1, MA(H, 8), MA(L, 8));
Trigger = IIf(C>Hilo, colorCustom9, colorCustom5);

Plot(Hilo, _DEFAULT_NAME(), Trigger, styleStaircase);
 

johnnypareek

Well-Known Member
#2
Hi,

Here it is :)

HTML:
/*Gann HiLo*/
per=Optimize("Per",Param("Per",8,1,55,1),1,55,1);

Hld = IIf(C > Ref(MA(H, per), -1), 1, IIf(C < Ref(MA(L, per), -1), -1, 0));
Hlv = ValueWhen(Hld != 0, Hld, 1);
Hilo = IIf(Hlv == -1, MA(H, per), MA(L, per));
Trigger = IIf(C>Hilo, colorCustom9, colorCustom5);
Plot(C,"",1,128);
Plot(Hilo, _DEFAULT_NAME(), Trigger, styleStaircase);
SetPositionSize( 50, spsShares );
Buy=Cross(C,Hilo);
Sell=Cross(Hilo,C);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorGreen, 0,L, Offset=-25); 
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorRed, 0,H, Offset=-25);
enjoy
 
Last edited:
#5
Hi johnnypareek,

Awesome!!Thanks very much.Since starting using Amibrkr 4 months back struggling to

get these arrows.But the formula makes another chart with arrows ,can the arrows

shown in main chart?

cheers

thanks

PKJee
 

sr114

Well-Known Member
#7
johnnypareek bro please could u setting gann hi lo afl, only line without price bar chart, thanks again!:thumb:
/*Gann HiLo*/
per=Optimize("Per",Param("Per",8,1,55,1),1,55,1);

Hld = IIf(C > Ref(MA(H, per), -1), 1, IIf(C < Ref(MA(L, per), -1), -1, 0));
Hlv = ValueWhen(Hld != 0, Hld, 1);
Hilo = IIf(Hlv == -1, MA(H, per), MA(L, per));
Trigger = IIf(C>Hilo, colorCustom9, colorCustom5);
//Plot(C,"",1,128);
Plot(Hilo, _DEFAULT_NAME(), Trigger, styleStaircase);
SetPositionSize( 50, spsShares );
Buy=Cross(C,Hilo);
Sell=Cross(Hilo,C);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorGreen, 0,L, Offset=-25);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorRed, 0,H, Offset=-25);
courtsey - Jhonny Bhai

use this piece of code and u will get only the hilo lines and not the close part.

sr
 
Last edited:
#9
anybody help me please , if price close above the gann(green line) line buy, and if price close below the gann(redline) line and sell with arrow

thanks a lot for advance


/*Gann HiLo*/

Hld = IIf(C > Ref(MA(H, 8), -1), 1, IIf(C < Ref(MA(L, 8), -1), -1, 0));
Hlv = ValueWhen(Hld != 0, Hld, 1);
Hilo = IIf(Hlv == -1, MA(H, 8), MA(L, 8));
Trigger = IIf(C>Hilo, colorCustom9, colorCustom5);

Plot(Hilo, _DEFAULT_NAME(), Trigger, styleStaircase);
i didnt get u ...pls explain me wht is tht. Thnx in advnce.
 

Similar threads