Code:
/*
Chandelier Exit (long) = 22-day High - ATR(22) x 3
Chandelier Exit (short) = 22-day Low + ATR(22) x 3
*/
period = 22;
HH = HHV( C, 22 );
LL = LLV( C, 22 );
EnableLong = ParamToggle("Long", "On|Off", 0);
EnableShort = ParamToggle("Short", "On|Off", 0);
CHST_L = HH - ATR(period) * 3;
CHST_S = LL + ATR(period) * 3;
if(EnableLong == 0){
Plot(CHST_L, "A", colorAqua);
}
if(EnableShort == 0){
Plot(CHST_S, "B", colorBlueGrey);
}
Could I ask someone to verify that my Chandelier Stop code is correct? I have been using CHST for a while now using another platform and I quite like it. I am in the process of making the switch to Amibroker and I want to make sure this is correct because in the platform I used to use, the lines were much flatter showing more like a "highest high/lowest low" type of line but this code produces a more wavy line like a standalone ATR that I would not expect.
Also, I'm not sure if it's possible in Amibroker but I would like to be able to only show the short or the long CHST line after the price breaks through the other. Something like this:
For now I have just created parameter toggles so can disable them easily but I just want to know what the capabilities and limitations of Amibroker are for this sort of thing.
Thanks!