Need AFl with Following Condition

Aarav11

Well-Known Member
#1
Hi All,

I need a AFL which will find the the bar with highest change (High - Low) uptil the specified period (a changeable parameter where we can specify the number of bars) and draw 2 horizontal line forward from that point. The first Horizontal line will be from the high and other will be from the low.

It should be Time Frame independent.

Thanks A lot.

Aarav
 

Aarav11

Well-Known Member
#2
any one who can help me?

johny or anyone else.
 
#4
Hi All,

I need a AFL which will find the the bar with highest change (High - Low) uptil the specified period (a changeable parameter where we can specify the number of bars) and draw 2 horizontal line forward from that point. The first Horizontal line will be from the high and other will be from the low.

It should be Time Frame independent.

Thanks A lot.

Aarav
Code:
period = Param("Period HiLo", 50, 1, 1000, 1);
hihigh = LastValue( HHV(H, period) );
lolow = LastValue( LLV(L, period) );

Plot(hihigh, "HiHigh", colorbrightgreen, styleline);
Plot(lolow, "LoLow", colorred, styleline);
 

Aarav11

Well-Known Member
#5
Code:
period = Param("Period HiLo", 50, 1, 1000, 1);
hihigh = LastValue( HHV(H, period) );
lolow = LastValue( LLV(L, period) );

Plot(hihigh, "HiHigh", colorbrightgreen, styleline);
Plot(lolow, "LoLow", colorred, styleline);
Thanks for the AFL.

But i want a AFL which will draw Horizontal line from low and high of the bar which has highest "High - Low" value during the specified period.

like say for past 5 days the high low difference of RIL is
day 1 - 10
day 2 - 20
day 3 - 8
day 4 - 5
day 5 - 13

so the highest High - Low value i got is on Day 2 so i want to draw horizontal line form day 2 High and Day 2 Low in forward direction.
 

Aarav11

Well-Known Member
#6
Thanks for the AFL.

But i want a AFL which will draw Horizontal line from low and high of the bar which has highest "High - Low" value during the specified period.

like say for past 5 days the high low difference of RIL is
day 1 - 10
day 2 - 20
day 3 - 8
day 4 - 5
day 5 - 13

so the highest High - Low value i got is on Day 2 so i want to draw horizontal line form day 2 High and Day 2 Low in forward direction.
Any one who can help??
 

KelvinHand

Well-Known Member
#7
Any one who can help??
Sorry I cannot help you because you never say please.:lol:

Code:
period = Param("Period HiLo", 5, 1, 1000, 1);
LHColor = ParamColor("Last High", colorRed);
LLColor = ParamColor("Last Low", colorBrightGreen);
HLStyle = ParamStyle("Last Hi/Lo Style", styleDots, maskAll);

idx = LastValue(HHVBars( H, period ));

LHigh = LastValue( Ref(H, -idx) );
LLow = LastValue( Ref(L, -idx) );



LastHigh = Null;
LastLow = Null;


for(i=BarCount-idx-1; i<BarCount; i++)
{
    LastHigh[i]= LHigh[i];
    LastLow[i] = LLow[i];
}


Plot(LastHigh, "Last High", LHColor, HLStyle);
Plot(LastLow, "Last Low", LLColor, HLStyle);
 
Last edited:

Aarav11

Well-Known Member
#8
Sorry I cannot help you because you never say please.

Code:
period = Param("Period HiLo", 5, 1, 1000, 1);
LHColor = ParamColor("Last High", colorRed);
LLColor = ParamColor("Last Low", colorBrightGreen);
HLStyle = ParamStyle("Last Hi/Lo Style", styleDots, maskAll);

idx = LastValue(HHVBars( H, period ));

LHigh = LastValue( Ref(H, -idx) );
LLow = LastValue( Ref(L, -idx) );



LastHigh = Null;
LastLow = Null;


for(i=BarCount-idx-1; i<BarCount; i++)
{
    LastHigh[i]= LHigh[i];
    LastLow[i] = LLow[i];
}


Plot(LastHigh, "Last High", LHColor, HLStyle);
Plot(LastLow, "Last Low", LLColor, HLStyle);
Hey thanks. I will make sure from next time i will. thanks. I will test it later.
 

Similar threads