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

Previous 20 Days Highest High & Lowest Low for Amibroker (AFL)

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

Previous “n” days highest high and lowest low Amibroker AFL.

Source here…

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("N_Day_HiLo");

// Set chart display parameters
// Chart background is Black,
// Date Axis displayed,
// Long titles wrapped to next line

SetChartOptions(0, chartShowDates | chartWrapTitle);
SetChartBkColor(colorBlack);

// Locate Highest HIGH and Lowest LOW in last N days

N = Param("Days to go back(Excl today)", 10, 2, 200, 1);
PriceStyle = ParamStyle("Chart Type", styleCandle, maskPrice);
LineStyle = ParamStyle("Line Style");

NDayHi = H[BarCount - 1 - N];
NDayLo = L[BarCount - 1 - N];
XH = XL = BarCount - 1 - N;

for(i = BarCount - 1 - N; i < BarCount - 1; i++)
{
if(H[i] > NDayHi)
{
NDayHi = H[i];
XH = i;
}
if(L[i] < NDayLo)
{
NDayLo = L[i];
XL = i;
}
}


// Define the Lines to be drawn

HLine = LineArray(BarCount - 1 - N, NDayHi, BarCount - 2, NDayHi);
LLine = LineArray(BarCount - 1 - N, NDayLo, BarCount - 2, NDayLo);

// Plot chart

_N(Title = StrFormat("{{NAME}} ({{INTERVAL}}) {{DATE}} {{OHLCX}} Vol=%1.0f\n{{VALUES}}", V));

Plot(C, "", colorGrey50, PriceStyle);
Plot(Hline, WriteVal(N, 1.0) + " Day Hi", colorBrightGreen, LineStyle);
Plot(LLine, WriteVal(N, 1.0) + " Day Lo", colorYellow, LineStyle);

_SECTION_END();

3 comments

1. raj2nidhi

NICE

2. Tarique

so nice

3. abhijeet_f

thanks

Leave Comment

Please login here to leave a comment.

Back