[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Trading range



PureBytes Links

Trading Reference Links

Hi all,
has anyone developed a trading range formula that works? The best I could do is this

Period   = Param("Period", 10, 1, 100, 1);
VolRange = Param("Volatility Range", 2, 0, 5, 0.5);
Width    = VolRange *ATR(20)/C*100;

tr       = (Ref(HHV(H,Period),-1) < C*(1 + Width/100)) AND 
(Ref(LLV(L,Period),-1) > C*(1 - Width/100));
trPerc   = IIf((Ref(HHV(H,Period),-1) < C*(1 + Width/100)) AND 
(Ref(LLV(L,Period),-1) > C*(1 - Width/100)), (C - 
Ref(LLV(L,Period),-1))/(Ref(HHV(H,Period),-1) - Ref(LLV(L,Period),-1))*100, 0);

bkup     = IIf((Ref(tr,-1) == 1) AND (C > Ref(Ref(HHV(H,Period),-1),-1)), 100, 0);
bkdown   = IIf((Ref(tr,-1) == 1) AND (C < Ref(Ref(LLV(L,Period),-1),-1)), 100, 0);

GraphXSpace = 2;

Plot(trPerc, "TRADING RANGE ( " + WriteVal(Width, 1.0) + " % )", colorBlue, 
styleHistogram | styleThick);
Plot(bkup, "  BKUP", colorGreen, styleHistogram | styleThick);
Plot(bkdown, "  BKDOWN", colorRed, styleHistogram | styleThick);
Plot(10, "", IIf(tr, colorLightOrange, colorWhite), 
styleOwnScale|styleArea|styleNoLabel, -1, 100 );

I didn't find a way to plot it from what it's considered trading range start.
Any suggestion is welcome

Franco


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/