help on AFL for plotting range of the entire day

SwingKing

Well-Known Member
#1
I was looking for an AFL which would automatically plot a horizontal range on the highest and lowest point on intraday basis ... Can anyone help on this ...

Req:
1) Will be using a 5-min chart
2) Want horizontal line plotted on the price chart (0955 - 1530) at the highest and lowest point of the day ...

Can this be done ???
 

vinodkiyer

Well-Known Member
#2
isRth = TimeNum() >= 094500 & TimeNum() <= 095459;
isdRth = TimeNum() >= 094500 & TimeNum() <= 160000;
aRthL = IIf(isRth, L, 1000000);
aRthH = IIf(isdRth, H, Null);
aRthLd = IIf(isdRth, L, 1000000);
DayH = TimeFrameCompress( aRthH, inDaily, compressHigh );
DayH = TimeFrameExpand( DayH, inDaily, expandFirst );
DayL = TimeFrameCompress( aRthLd, inDaily, compressLow );
DayL = TimeFrameExpand( DayL, inDaily, expandFirst );
Bars = BarsSince(TimeNum() >= 94500 AND TimeNum() < 095959);//,BarIndex(),1); // AND DateNum()==LastValue(DateNum());
x0 = BarCount-LastValue(Bars);
x1 = BarCount-1;
DayHline=LineArray(x0,LastValue(DayH),x1,LastValue(DayH),0);
DayLline=LineArray(x0,LastValue(DayL),x1,LastValue(DayL),0);

add this to your formula file
 

SwingKing

Well-Known Member
#4
Plot(DayHline,"DayH",colorYellow,styleLine|styleNoRescale);
Plot(DayLline,"DayL",colorYellow,styleLine|styleNoRescale);

also this following to the above
Thanks a lot for this ... will let u know If I need any further help ... working on a system ... will be releasing it to traderji forum once its complete ...
 

shanki99

Well-Known Member
#8
isRth = TimeNum() >= 094500 & TimeNum() <= 095459;
isdRth = TimeNum() >= 094500 & TimeNum() <= 160000;
aRthL = IIf(isRth, L, 1000000);
aRthH = IIf(isdRth, H, Null);
aRthLd = IIf(isdRth, L, 1000000);
DayH = TimeFrameCompress( aRthH, inDaily, compressHigh );
DayH = TimeFrameExpand( DayH, inDaily, expandFirst );
DayL = TimeFrameCompress( aRthLd, inDaily, compressLow );
DayL = TimeFrameExpand( DayL, inDaily, expandFirst );
Bars = BarsSince(TimeNum() >= 94500 AND TimeNum() < 095959);//,BarIndex(),1); // AND DateNum()==LastValue(DateNum());
x0 = BarCount-LastValue(Bars);
x1 = BarCount-1;
DayHline=LineArray(x0,LastValue(DayH),x1,LastValue(DayH),0);
DayLline=LineArray(x0,LastValue(DayL),x1,LastValue(DayL),0);

add this to your formula file

Can u plz make changes in the above AFL to suit the current mkt timing. I tried, but this 09 45 thing is confusing me
 

Similar threads