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

Volume Color with Dynamic Limit for Amibroker (AFL)
kaiji
almost 15 years ago
Amibroker (AFL)

Rating:
5 / 5 (Votes 1)
Tags:
amibroker, volume, intraday

NOTE: This script ONLY WORKS properly on N-minute based charts including hourly. Range, tick, and volume based charts will default to the standard volume value.

Limit the max height of volume bars to some fraction of the average daily volume from the previous X number of days. Useful for displaying intraday bars that have frequent abnormal bars that make it impossible to see the rest of the volume bars for the day. Bars that extend beyond this amount are colored black (changable in parameters). The fraction is changeable in the parameters as well. This fraction is multiplied by the interval so that it scales with 1 minute, 5 minute, 15 minute, hourly, etc.

By bluueskyy

Similar Indicators / Formulas

New V spiker Moded-1.50
Submitted by Kutubi over 13 years ago
Better Volume Indicator
Submitted by kaiji almost 15 years ago
OHLC indicator
Submitted by godisbogus almost 15 years ago
1 Minute inside 6 bar consolidation
Submitted by alvaroaltair over 10 years ago
INTRADAY AVERAGE VOLUME
Submitted by shethia about 14 years ago
Volume Scan report
Submitted by anandnst over 12 years ago

Indicator / Formula

Copy & Paste Friendly
/*-------------------------------------------------------------
Volume Color with Dynamic Limit

NOTE: This script ONLY WORKS properly on N-minute based charts 
including hourly.  Range, tick, and volume based charts
will default to the standard volume value.

Limit the max height of volume bars to some fraction of the
average daily volume from the previous X number of days.  Useful
for displaying intraday bars that have frequent abnormal bars
that make it impossible to see the rest of the volume bars
for the day.  Bars that extend beyond this amount are colored black
(changable in parameters).  The fraction is changeable in the
parameters as well.  This fraction is multiplied by the interval
so that it scales with 1 minute, 5 minute, 15 minute, hourly, etc. 

-------------------------------------------------------------*/


pUpColor = ParamColor("Up Color", colorGreen );
pDownColor = ParamColor("Down Color", colorRed );

_TRACE("intval = " + NumToStr(Interval(), 0.10));

if (Interval() > 1)
{
	pTooHighColor = ParamColor("Too High Color", colorBlack );
	pPrevDayVMaxFraction = Param("Max Fraction of Prev Day V", 0.004, 0.00005, 1,0.0005) * Interval()/60;
	pDaysOfVolToAverage = Param("Days of Vol to Avg", 10, 2, 100, 1);

	SetBarsRequired(pDaysOfVolToAverage * 8 *  Interval()/60, 100);

	DayV = TimeFrameCompress( V, inDaily, compressVolume );
	DayVAvg = MA(DayV, pDaysOfVolToAverage);
	PrevDayVMa = TimeFrameExpand( Ref(DayVAvg, -1), inDaily, expandFirst );

	VIsTooHigh = V > PrevDayVMa  * pPrevDayVMaxFraction;

	aRthVp = IIf(VIsTooHigh, PrevDayVMa  * pPrevDayVMaxFraction , V);
	VColor = IIf(VIsTooHigh, pTooHighColor, IIf( C > O, pUpColor, pDownColor ));

	Plot( aRthVp, "Volume", VColor, ParamStyle( "Style", styleHistogram | styleThick, maskHistogram  ) );

	//plot the real volume in its own scale so that you can 
	//click on the overflow bar and see the actual volume in the pane title
	Plot(V, "True Volume", colorWhite, styleNoDraw | styleOwnScale);

	Title = "True Volume = " + NumToStr(V, 0.0) + ",    Max Visible Volume = " + NumToStr(PrevDayVMa  * pPrevDayVMaxFraction, 0.0);
}
else 
{
	//display standard up down color display as this Interval is not supported
	VColor = IIf( C > O, pUpColor, pDownColor );

	Plot( V, "Volume", VColor, ParamStyle( "Style", styleHistogram | styleThick, maskHistogram  ) );

	Title = "True Volume = " + NumToStr(V, 0.0) + ",    Max Visible Volume = NA";
}

0 comments

Leave Comment

Please login here to leave a comment.

Back