Hi Yves,
All I can ask is 1) what are you trying to chart and 2)
whether you were overlaying this code on a price chart or simply adding it to a
pane by itself.
1) If the instrument you are charting has very little
delta from day to day, week to week, month to month, and the volume is minimal,
perhaps that is why you have a lot of blank space.
2) But I'm willing to bet
that you are adding the code to a pane by itself, which was not what the
original poster asked to accomplish (a code to overlay on a pane was
requested). If you are adding this to it's own pane, all you will
have is volume, and as the default was to have the volume divided by 4 to reduce
it's height you get the 75% of the screen blank, about which you
complained. If this is the case, perhaps you should
either:
a) try using the VHeight param to
increase the height of the bars (you can use the parameters menu the chart
to do this) - if set to a value of 1 the tallest bars should fill the pane; or
b) multiply the volume by
changing my code to multiply instead of divide the volume or make
the VHeight param have a minimum value of a fraction (e.g. VHeight = Param( "1/N
Height", 4, 0.1,
10, 0.1 );
[the volume divisor was originally so that the volume bars do not overrun
price bars, but dividing by a fraction will multiply their
height);
I recommend you try a) first.
If you have a single big volume day, and the surrounding
days on the chart are significantly less, a little more coding would be required
to reduce the height of the high volume day (and perhaps color code it
differently so that you would know that it's height had been adjusted). I
leave that coding to you to work on as a project if you are so inclined
-- you've been using AB for several months so you should be able to do
that.
Peace and Justice ---
Patrick
----- Original Message -----
Sent: Wednesday, January 27, 2010 11:36
PM
Subject: Réf. : Re: [amibroker] Re:
Volume at the Bottom of the Chart
Good idea Guy,
But I'm have a 75% of the screen who he have
nothing
Merci YLTech ( Yves L. ) Le présent
message et les documents qui y sont joints sont réservés exclusivement
au destinataire indiqué. Il est strictement interdit d'en utiliser ou
d'en divulguer le contenu. Si vous recevez le présent message par
erreur, veuillez le détruire S.V.P. et nous en aviser immédiatement afin
que nous puissions corriger nos dossiers. Merci. This
message and the attached documents may contain privileged or
confidential information that are intended to the addressee only. Any
unauthorized disclosure is strictly prohibited. If you happen to receive
this message by error, please delete it and notify us immediately so
that we may correct our internal records. Thank
you. yltech@xxxxxxxxxxxx
-------Message original-------
Date : 28/01/10
01:07:59
Sujet : Re:
[amibroker] Re: Volume at the Bottom of the Chart
Hi Eswar,
You can do this for yourself if you start to learn some basic AFL
coding (which should be your goal if you want to use AB customized to
your own preferences). You already are part way there as you
have defined the conditions you want to display, now you just need to
incorporate them into an indicator which you can overlay on a
price chart. To get you started, try the following:
Codename =
"Volume -
4 Color"
;
// Color
Conditions
Upgreen =
C >
Ref(
C,
-1 )
AND
C >
O
;
DownRed =
C <=
Ref(
C,
-1 )
AND
C <
O;
UpPurple =
C >
Ref(
C,
-1 )
AND
C <
O;
DownBlue =
C <=
Ref(
C,
-1 )
AND
C >
O;
VColor =
IIf( UpGreen,
colorGreen,
IIf( DownRed,
colorRed,
IIf( UpPurple,
colorPlum,
colorBlue ) )
);
VStyle
= ParamStyle(
"Volume
Style",
styleHistogram |
styleOwnScale |
styleThick |
styleNoLabel,
maskHistogram )
;
VHeight =
Param(
"1/N
Height",
4,
1,
10,
0.5
);
Plot(
V,
"
Volume", VColor,
VStyle, VHeight );
In this code, I've substituted Plum for Purple and added a
parameter setting to adjust the height of the volume bars (to prevent
overwriting your price code -- right click on the chart, select
parameters). To overlay this on another chart, first click on the target
chart, then right click on the code in the Charts tree (save it
first to a Named folder under Formulas and it will be there in the
tree) and select Overlay from the drop down menu. If you just want to
use it as a volume chart, select either Insert or Insert Linked.
Hope this will help you realize what you can do with very
little effort to learn basic AFL.
Peace and Justice --- Patrick
----- Original Message -----
Sent: Wednesday, January 27, 2010
8:40 PM
Subject: Re: [amibroker] Re: Volume
at the Bottom of the Chart
Hi, I too find it useful to view the volume histogram
when colored based on direction from previous close. Thanks. However,
combining this with the relation of Close to today's Open can offer far
better insights. Consider the following states: 1. C >Ref(C,
-1) AND C>O - Upvolume green 2. C<=Ref(C,-1) AND C<O - Down
volume - Red 3. C >Ref(C, -1) AND C<O - Upvolume - Purple 4.
C<=Ref(C, -1) AND C>O - Downvolume - Blue States 3. and 4.
typically preceede changes in trend and reflect emerging patterns like
the gapped morning/ evening star. It would be even better if the price
candle is colored differently along with volumes, to reflect these
potential inflexion points. Would greatly appreciate if someone
could amend the code for these additional states into a formula that I
can drag-drop onto the price chart.
best, Eswar
2010/1/26 edwol53 <edwol@xxxxxxxxxau>
Hello Mike & Barry
Quite correctly - I was focused on the
efficiency/elegance of the code and I did not pay enough attention to
the code itself ie as you correctly pointed out the second condition
needed to be considered. Thankyou for pointing that out.
My take
on the colour volume is slightly different where the colour of the
volume reflects the current close relative to the previous period's
close ie C - Ref(C, -1) and is more insightful when using the volume
histogram at a glance.
For those who aggree with this view the
code segment below may be of use.
_SECTION_BEGIN("Variable Volume
Hight2");
direction = C - Ref(C, -1); VolColor = (direction
> 0) * ParamColor( "UpColor" ,colorGreen) + (direction <=
0)*ParamColor( "DnColor" ,colorRed) ;
vHeight = Param("Volume: 1 / Height",10, 1, 100, 1.0)
; // height as % of screen
Plot(Prec(Volume ,0),"V",VolColor,
styleNoTitle | styleOwnScale| styleNoLabel | styleHistogram |styleThick
| styleNoLabel, vHeight); _SECTION_END( );
Cheers Ed
--- In amibroker@xxxxxxxxxps.com, "Mike"
<sfclimbers@x ..> wrote: > > You have not
correctly inverted the opposite condition. The _expression_ that you
should be trying to form is as follows; > > In the case of
up volume: > > ( (1 * colorGreen) + (0 * colorRed)
) > > which you will note is equivalent to simply saying
"colorGreen" since we are zeroing out the colorRed value. Conversely, in
the case of down volumne: > > ( (0 * colorGreen) + (1 *
coloreRed) ) > > which is the same as simply saying
"colorRed" since we zero out the colorGreen value. > > In
your code you have not inverted the up condition for application to down
color. Therefore your values are evaluating to other colors. >
> In the case of up volume: > > 1 * colorGreen + 1 *
colorRed > > In the case of down volume: > > 0
* colorGreen + 0 * colorRed > > Change your code to
something like: > > (direction * colorGreen) + (!direction
* colorRed); > > better yet, change your variable name
accordingly: > > (upVolume * colorGreen) + (!upVolume *
colorRed); > > Mike > > --- In amibroker@xxxxxxxxxps.com, "edwol53"
<edwol@> wrote: > > > > Hello Barry > >
> > I made a slight modification to your code below, which
should give the same clour output for volume, but it instead it plots
black for green & light grey for red. The boolean _expression_ for
direction should resolve to 1 (true) or 0 (false) and Volcolor should
plot the same as you original code. Can you why this is not the case
? > > > > _SECTION_BEGIN("Variable Volume
Hight2"); > > direction = C > O OR (C == O AND (H-C) <=
(C-L) ); > > VolColor = (direction) * ParamColor( "UpColor"
,colorGreen) + (direction )*ParamColor( "DnColor" ,colorRed) ; >
> vHeight = Param("Volume: 1 / Height",10, 1, 100, 1.0) ; // height
as % of screen > > Plot(Prec(Volume ,0),"V",VolColor,
styleNoTitle | styleOwnScale| styleNoLabel | styleHistogram |
styleNoLabel, vHeight); > > _SECTION_END(); > >
> > Thanks > > Ed > > > > --- In
amibroker@xxxxxxxxxps.com, "Barry"
<razzbarry@> wrote: > > > > > > The
formula in post 146327 has parameters that allow you to change the
color. OR you can use this version which also has colors red and green
but also has parameters for the colors. Just make a formula out of it
and drag and drop onto the price all in one screen. > > >
> > > _SECTION_BEGIN("Variable Volume Hight"); >
> > VolColor = (C > O OR (C == O AND (H-C) <= (C-L) )) *
ParamColor( "UpColor" ,colorGreen) + (C < O OR (C == O AND (H-C) >
(C-L)) )*ParamColor( "DnColor" ,colorRed) ; > > > vHeight =
Param("Volume: 1 / Height",10, 1, 100, 1.0) ; // height as % of
screen > > > Plot(Prec(Volume ,0),"V",VolColor, styleNoTitle
| styleOwnScale| styleNoLabel | styleHistogram | styleNoLabel, vHeight);
> > > _SECTION_END(); > > > > >
> Barry > > > > > > --- In amibroker@xxxxxxxxxps.com, "Richard"
<areehoi@> wrote: > > > > > > > >
I'm interested in using this "Price (all in one)" chart but, how would I
change code to show color ...Green for up volume and red for down
volume. Thanks > > > > > > > > Dick
H > > > > > > > > --- In amibroker@xxxxxxxxxps.com, Tomasz Janeczko
<groups@> wrote: > > > > > > > >
> > Hello, > > > > > > > > >
> Price (all in one).afl shipped with AmiBroker contains the code
that > > > > > does that exactly. > > >
> > You can use AFL Editor to see the underlying code and see how
it is done. > > > > > > > > > >
Best regards, > > > > > Tomasz Janeczko > >
> > > amibroker.com > > > > > >
> > > > On 2010-01-25 11:01, osp2osp wrote: > >
> > > > Mike, > > > > > > > >
> > > > Thank you very much for your kind reply. >
> > > > > > > > > > > It is dead end
for me. May be, I have to place my request properly. > > >
> > > > > > > > > Price is already plotted
along with moving averages and Bollinger Bands. > > > >
> > > > > > > > I just want to overlay the
volume bars at the bottom of the screen. So that, the area available for
price plot is not reduced and at the same time the volume spikes do not
go up to the top of window. > > > > > > >
> > > > > Hope, I am clear. > > > > >
> > > > > > > Thank you once again. > >
> > > > > > > > > > Warm
Regards > > > > > > > > > > >
> > > > > > > --- In amibroker@xxxxxxxxxps.com,
"Mike"<sfclimbers@> wrote: > > > > > >
> > > > > >> Multiple plots on a single pane
have been discussed in the following thread. Read through it and see if
it's what you want: > > > > > >> > >
> > > >> http://finance.groups.yahoo.com/group/amibroker/message/143807 >
> > > > >> > > > > > >>
Mike > > > > > >> > > > > >
>> --- In amibroker@xxxxxxxxxps.com,
"osp2osp"<osp2osp@> wrote: > > > > > >>
> > > > > >>> > > > > >
>>> Hi, > > > > > >>> > >
> > > >>> Thanks for the reply. I tried that
already. > > > > > >>> > > > >
> >>> Plot(Volume,
"",MyVolCol,styleOwnScale+styleHistogram,0,20); >
> > > > >>> > > > > >
>>> Not getting the desired the results. > > > >
> >>> > > > > > >>> Thank You
Very Much. > > > > > >>> > > >
> > >>> Regards. > > > > >
>>> > > > > > >>> --- In amibroker@xxxxxxxxxps.com, Keith
McCombs<kmccombs@> wrote: > > > > > >>>
> > > > > >>>> Check AFL Help for how to
use Plot() function. You need to use sixth > > > > >
>>>> parameter, maxvalue. > > > > >
>>>> > > > > > >>>> osp2osp
wrote: > > > > > >>>> > > >
> > >>>>> > > > > >
>>>>> > > > > > >>>>>
Hi, > > > > > >>>>> > > >
> > >>>>> I like to plot the volume in the price
window itself and tried the > > > > >
>>>>> following: > > > > >
>>>>> > > > > > >>>>>
Plot(Volume,
"Vol",MyVolCol,styleOwnScale+styleHistogram); >
> > > > >>>>> > > > > >
>>>>> It plots the volume bars in entire price
window. > > > > > >>>>> > >
> > > >>>>> I need help to plot ie. overlay
volume at the bottom of the price > > > > >
>>>>> window, taking not more than 20% of the entire
price window. > > > > > >>>>> >
> > > > >>>>> Request someone to help
me. > > > > > >>>>> > > >
> > >>>>> Thank you very much. > > >
> > >>>>> > > > > >
>>>>> Warm Regards. > > > > >
>>>>> > > > > > >>>>> K
Karunakaran > > > > > >>>>> >
> > > > >>>>> > > > > >
>>>>> > > > > > >>>>
> > > > > >>> > > > > >
>> > > > > > > > > > > >
> > > > > > > > > > > > >
------------------------------------ > > >
> > > > > > > > > **** IMPORTANT PLEASE
READ **** > > > > > > This group is for the
discussion between users only. > > > > > > This is
*NOT* technical support channel. > > > > >
> > > > > > > TO GET TECHNICAL SUPPORT send an
e-mail directly to > > > > > > SUPPORT {at} amibroker.com > >
> > > > > > > > > > TO SUBMIT
SUGGESTIONS please use FEEDBACK CENTER at > > > > >
> http://www.amibroker.com/feedback/ > >
> > > > (submissions sent via other channels won't be
considered) > > > > > > > > > > >
> For NEW RELEASE ANNOUNCEMENTS and other news always check
DEVLOG: > > > > > > http://www.amibroker.com/devlog/ > >
> > > > > > > > > > Yahoo! Groups
Links > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > >
> >
|
__._,_.___
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
__,_._,___
|