[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Re: How to plot volume in price pane using 1/3 of pane?



PureBytes Links

Trading Reference Links

Bill,

Many, many thanks!!!   This worked great!

I added the functions to my include file and add a new volume section to my
primary volume analysis chart.  Before I had the volume in a separate pane.
Now it's in the price chart pane.

Below is my new Volume Section for reference.  Since I like color volume
bars, I add code for those.

Regards,

Dan.


_SECTION_BEGIN("Volume");
if (PlotVolumeBool)
	{
	V = round(V/1000);
	Plot(V, "Vol", IIf( C > Ref(C, -1), ParamColor("Up Color",
colorGreen ), ParamColor("Down Color", colorRed ) ), styleHistogram |
styleOwnScale + styleNoLabel + styleNoTitle, L1(V, 5, 65), U1(V, 5, 65) );
	Plot( round(MA( V, 50 )), "Vol MA(50)", ParamColor( "Vol MA Color",
colorOrange), styleLine | styleOwnScale + styleNoLabel + styleNoTitle, L1(V,
5, 65), U1(V, 5, 65) ); 
	}

_SECTION_END(); 
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of Bill Barnard
Sent: Saturday, October 08, 2005 10:34 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: How to plot volume in price pane using 1/3 of pane?


--- In amibroker@xxxxxxxxxxxxxxx, "Dan Clark" <dan_public@xxxx> wrote:
>
> Hi,
> 
> I'd like to overlay a volume histogram in a price bar pane, but set it up
so
> that the tallest volume bar take up onlys 1/3 of the pane.  How can I do
> that?   


Dan, Here is a way. You can change the numbers for the LowerFreespacePercent
and the UpperFreespacePercent to suit your needs. (Be sure to undo the
line-wrap in the long Title statement.) Bill

// Lower limit for plotting one variable
function L1 (Var, LowerFreespacePercent, 
                        UpperFreespacePercent)
{
    vis = Status("barvisible");
    Hii = LastValue(Highest(Var*vis));
    Loo = LastValue(Lowest((Var - Hii)*vis) + Hii);
    range = Hii - Loo;
    rangePercent = 100 - LowerFreespacePercent - 
                           UpperFreespacePercent; 
    mult = range / rangePercent;
    result = Loo - mult*LowerFreespacePercent;
    return result;
}

// Upper limit for plotting one variable
function U1 (Var, LowerFreespacePercent, 
                        UpperFreespacePercent)
{
    vis = Status("barvisible");
    Hii = LastValue(Highest(Var*vis));
    Loo = LastValue(Lowest((Var - Hii)*vis) + Hii);
    range = Hii - Loo;
    rangePercent = 100 - LowerFreespacePercent - 
                                   UpperFreespacePercent; 
    mult = range / rangePercent;
    result = Hii + mult*UpperFreespacePercent;
    return result;
}

_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( Close, "Close", colorRed, styleNoTitle | styleBar | 
    styleOwnScale, L1(Close, 15, 12), U1(Close, 15, 12) );    
Plot(Volume, "volume", colorLightBlue, styleHistogram | 
    styleOwnScale, L1(Volume, 5, 65), U1(Volume, 5, 65) );







Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html




SPONSORED LINKS 
Investment management software
<http://groups.yahoo.com/gads?t=ms&k=Investment+management+software&w1=Inves
tment+management+software&w2=Real+estate+investment+software&w3=Investment+p
roperty+software&w4=Software+support&w5=Real+estate+investment+analysis+soft
ware&w6=Investment+software&c=6&s=200&.sig=_XXUzbE9l5lGlZNcMu4KNQ>  	Real
estate investment software
<http://groups.yahoo.com/gads?t=ms&k=Real+estate+investment+software&w1=Inve
stment+management+software&w2=Real+estate+investment+software&w3=Investment+
property+software&w4=Software+support&w5=Real+estate+investment+analysis+sof
tware&w6=Investment+software&c=6&s=200&.sig=5_sgDczz3ArKGMtJ9tFSJA>
Investment property software
<http://groups.yahoo.com/gads?t=ms&k=Investment+property+software&w1=Investm
ent+management+software&w2=Real+estate+investment+software&w3=Investment+pro
perty+software&w4=Software+support&w5=Real+estate+investment+analysis+softwa
re&w6=Investment+software&c=6&s=200&.sig=_N6zcwefgp4eg5n6oX5WZw>  	
Software support
<http://groups.yahoo.com/gads?t=ms&k=Software+support&w1=Investment+manageme
nt+software&w2=Real+estate+investment+software&w3=Investment+property+softwa
re&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Invest
ment+software&c=6&s=200&.sig=MJ2jP31F3n64RDZkDadU8w>  	Real estate
investment analysis software
<http://groups.yahoo.com/gads?t=ms&k=Real+estate+investment+analysis+softwar
e&w1=Investment+management+software&w2=Real+estate+investment+software&w3=In
vestment+property+software&w4=Software+support&w5=Real+estate+investment+ana
lysis+software&w6=Investment+software&c=6&s=200&.sig=GmF8PlAJASx0wrSaX5-Zlw>
Investment software
<http://groups.yahoo.com/gads?t=ms&k=Investment+software&w1=Investment+manag
ement+software&w2=Real+estate+investment+software&w3=Investment+property+sof
tware&w4=Software+support&w5=Real+estate+investment+analysis+software&w6=Inv
estment+software&c=6&s=200&.sig=aMgGsKT4w29dMAYUzQUKzg>  	


YAHOO! GROUPS LINKS 

*	 Visit your group "amibroker
<http://groups.yahoo.com/group/amibroker> " on the web.
  
*	 To unsubscribe from this group, send an email to:
 amibroker-unsubscribe@xxxxxxxxxxxxxxx
<mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe> 
  
*	 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> . 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<<attachment: winmail.dat>>