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

Visible Min and Max Value Demo for Amibroker (AFL)
kaiji
about 14 years ago
Amibroker (AFL)

Rating:
4 / 5 (Votes 2)
Tags:
amibroker, function

Demo of 2 fuctions I wrote, which will find the Maximum and Minimum value in the visible horizontal chart area. Can be used for many different reasons and this is only an example. Inpiration came from several different codes I have seen, but can’t at this moment find out who created them.

By Jorgen Wallgren – jorgen.wallgren [at] gmail.com

Similar Indicators / Formulas

Percent Rank
Submitted by genkumag over 12 years ago
Time Left for each bar
Submitted by novicetraders almost 14 years ago
Last Thursday Of The Month
Submitted by sahasra almost 13 years ago
Chandelier Exit Functions
Submitted by kaiji about 14 years ago
Adaptive Laguerre Filter from John Ehlers
Submitted by kaiji about 14 years ago
Averages Functions Include
Submitted by demon over 13 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Visible Max and Min Value Demo");
// Demo of 2 fuctions I wrote, which will find the Maximum and Minimum value in the visible horizontal chart area.
// Can be used for many different reasons and this is only an example. Inpiration came from several different codes
// I have seen, but can't at this moment find out who created them. Thanks anyway!!!
// I an new to AFL programming and this could probably be achieved in an easier way AND if so, please let me know.

Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle |
ParamStyle("Style") | GetPriceStyle() ); 

function VisibleMaxValue(Value)
{
 BI	= BarIndex();
 FirstVisibleBarIndex = Status("FirstvisiblebarIndex");
 FirstVisibleBar = FirstVisibleBarIndex == BI;
 HighestVisibleValue = HighestSince(FirstVisibleBar, Value);
 LastVisibleBarIndex = Status("LastvisiblebarIndex");
 BlankBars	= SelectedValue(LastVisibleBarIndex - BI);
 LastVisibleBar = LastVisibleBarIndex == BI + BlankBars;
 MaxValue 	= LastValue(ValueWhen(Lastvisiblebar, HighestVisibleValue));
 return MaxValue;
}

function VisibleMinValue(Value)
{
 BI	= BarIndex();
 FirstVisibleBarIndex = Status("FirstvisiblebarIndex");
 FirstVisibleBar = FirstVisibleBarIndex == BI;
 LowestVisibleValue	= LowestSince(FirstVisibleBar, Value);
 LastVisibleBarIndex	= Status("LastvisiblebarIndex");
 BlankBars	= SelectedValue(LastVisibleBarIndex - BI);
 LastVisibleBar = LastVisibleBarIndex == BI + BlankBars;
 MinValue 	= LastValue(ValueWhen(Lastvisiblebar, LowestVisibleValue));
 return MinValue;
}

Plot(VisibleMaxValue(High), "", colorGreen, 0);
Plot(VisibleMinValue(Low), "", colorRed, 0);

_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.

Back