want this situation to code in afl

bunti_k23

Well-Known Member
#1
i want a afl which joins hh hl ll lh, the above points shd be join by a line
like this in below image....this is the scenario now the falling lines shd b in red color and rising lines shd be in blue color :)
 

Attachments

mastermind007

Well-Known Member
#2
i want a afl which joins hh hl ll lh, the above points shd be join by a line
like this in below image....this is the scenario now the falling lines shd b in red color and rising lines shd be in blue color :)
H1 = Max(Ref (H, -1), H);
H2 = IIf(H1 == H, H, (H1 + H)/2);
Plot(H2, "H2", colorBlack, styleLine);

L1 = Min(Ref (L, -1), L);
L2 = IIf(L1 == L, L, (L1 + L)/2);
Plot(L2, "L2", colorBlack, styleLine);
 

bunti_k23

Well-Known Member
#3
H1 = Max(Ref (H, -1), H);
H2 = IIf(H1 == H, H, (H1 + H)/2);
Plot(H2, "H2", colorBlack, styleLine);

L1 = Min(Ref (L, -1), L);
L2 = IIf(L1 == L, L, (L1 + L)/2);
Plot(L2, "L2", colorBlack, styleLine);
not working brother:(
 

mastermind007

Well-Known Member
#4
not working brother:(
The code I've given only plots the top and the bottom line and is meant to convey the idea on how to go about it. You may have to further adjust it.

I was expecting that you will be able to add the price candle yourself.

Code:
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ),
styleNoTitle | styleCandle );

if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
	ToolTip = StrFormat("Open %g,\nHigh %g,\nLow %g,\nClose %g ROC (%.1f%%)\nVolume:" + WriteVal( V, 1.0 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}

_SECTION_END();
H1 = Max(Ref (H, -1), H);
H2 = IIf(H1 == H, H, (H1 + H)/2);
Plot(H2, "H2", colorBlack, styleLine);

L1 = Min(Ref (L, -1), L);
L2 = IIf(L1 == L, L, (L1 + L)/2);
Plot(L2, "L2", colorBlack, styleLine);
 

Similar threads