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

Positive Percentage Indicator for Amibroker (AFL)

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

This formula shows you the positive bar percentage of the script.

it calculates past bar data & average it with a percentage value.

you can combine this with your other indicators to get a Popper momentum idea.

like when you going to Long with your current indicators, do taste how much positivity there is on different time frames for that particular script.

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Positive Bars Percentage");


BarsUp=0;
BarsDown=0;
PCount = 0;
NCount = 0;
NewDay = Day() != Ref(Day(), -1);

for(i=0;i<BarCount;i++)
{
if(NewDay[i]==True)
{
BarsUp[i]=0;
BarsDown[i]=0;
PCount = 0;
NCount = 0;
}
//positive count
if(C[i]-O[i]>0)
{
PCount++;
BarsUp[i]=PCount;
BarsDown[i]=NCount;
}
//negative count
if(C[i]-O[i]<0)
{
NCount++;
BarsUp[i]=PCount;
BarsDown[i]=NCount;
}

}

BarsToday = 1 + BarsSince(NewDay);
PositiveBarsPercentage = BarsUp*100/BarsToday;
//Plot(BarsToday,"Today Bars",colorRed);
//Plot(BarsUp,"Positive Bars",colorblue);
//Plot(BarsDown,"Negative Bars",colorRed);
Plot(PositiveBarsPercentage,"PositiveBars Percentage",colorGreen);

_SECTION_END();

0 comments

Leave Comment

Please login here to leave a comment.

Back