Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

5 Line for Amibroker (AFL)

Rating:
3 / 5 (Votes 7)
Tags:
amibroker

By calculating difference between High/Low/Close of past 3 days, support & resistance lines are generated for trading today.

Screenshots

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("5Line");
DaysPar = Param("Days to Calculate Average Line",3);
VarSet("MaxHighVal",0);
VarSet("MinLowVal",0);

for(i = 1; i < DaysPar + 1; i++)
{
	MaxHighVal = MaxHighVal + TimeFrameGetPrice( "H", inDaily, -i )-TimeFrameGetPrice( "C", inDaily, -i );
	MinLowVal = MinLowVal + TimeFrameGetPrice( "C", inDaily, -i )-TimeFrameGetPrice( "L", inDaily, -i );
}
MaxHighY = TimeFrameGetPrice( "O", inDaily, 0 ) + (MaxHighVal/DaysPar);
MinLowY = TimeFrameGetPrice( "O", inDaily, 0 ) - (MinLowVal/DaysPar);
AvgLine1 = (MaxHighY + MinLowY)/2;
AvgLine2 = (MaxHighY + AvgLine1)/2;
AvgLine3 = (MinLowY + AvgLine1)/2;
TimeFrameSet( inDaily );
ArrayForLine1 = LineArray(0,LastValue(MaxHighY),160,LastValue(MaxHighY),3);
TimeFrameSet( inDaily );
ArrayForLine2 = LineArray(0, LastValue(AvgLine2) , 160, LastValue(AvgLine2), 3);
TimeFrameSet( inDaily );
ArrayForLine3 = LineArray(0, LastValue(AvgLine1), 160, LastValue(AvgLine1), 3);
TimeFrameSet( inDaily );
ArrayForLine4 = LineArray(0, LastValue(AvgLine3), 160, LastValue(AvgLine3), 3);
TimeFrameSet( inDaily );
ArrayForLine5 = LineArray(0, LastValue(MinLowY), 160, LastValue(MinLowY), 3);

Plot(ArrayForLine1, "", colorBlack, styleThick|styleDots|styleNoLabel,0,0,20);
Plot(ArrayForLine2, "", colorOrange, styleThick|styleDots|styleNoLabel,0,0,5);
Plot(ArrayForLine3, "", colorBlue, styleLine|styleNoTitle|styleNoLabel,0,0,5);
Plot(ArrayForLine4, "", colorOrange, styleThick|styleDots|styleNoLabel,0,0,5);
Plot(ArrayForLine5, "", colorBlack, styleThick|styleDots|styleNoLabel,0,0,20);
TimeFrameRestore();

_SECTION_END();



_SECTION_BEGIN("Price Chart");
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", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

2 comments

1. ashu123456789

how to use it plz help administator

2. neytiurlaber

Hi,

Can you put the price also?

Thanks

Leave Comment

Please login here to leave a comment.

Back