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

Re: [amibroker] Different chart styles in one pane?



PureBytes Links

Trading Reference Links

This is NOT recommended solution because Cum() forces
that formula uses all bars which is SLOW.

Better use BUILT-IN FEATURE that switches the style AUTOMATICALLY
depending on "Continuous quotations" flag (Symbol->Information).
For MUTUAL funds this flag is turned OFF - so LINE is plotted,
otherwise candlesticks are plotted.

To achieve this effect use
GetPriceStyle function AND use View->Price chart style->Auto

http://www.amibroker.com/guide/afl/afl_view.php?getpricestyle

As in BUILT-IN price chart:

SetChartOptions(0,chartShowArrows|chartShowDates);
_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( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Thomas Ludwig" <Thomas.Ludwig@xxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, December 16, 2006 3:53 PM
Subject: Re: [amibroker] Different chart styles in one pane?


> Great - this works! Thanks a lot, Steve!
>
> Best regards,
> Thomas
>
>> Hi - Your code is not correct, I think it turns the variable "Style" into a
>> boolean variable, which is an array and so cannot be used for the style
>> arg. Try this instead...
>>
>> if ( LastValue( Cum( High ) ) == LastValue( Cum( Low ) ) )
>> {
>>     Style = styleLine;
>>     Color = colorBlack;
>> }
>> else
>> {
>>     Style = styleCandle;
>>     Color = IIf( Rs, colorGreen, IIf( Fs, colorRed, colorBlack ));
>> }
>> Plot( C, "close", Color, style);
>>
>>
>> Steve
>>
>> ----- Original Message -----
>> From: "Thomas Ludwig" <Thomas.Ludwig@xxxxxx>
>> To: <amibroker@xxxxxxxxxxxxxxx>
>> Sent: Friday, December 15, 2006 3:00 AM
>> Subject: Re: [amibroker] Different chart styles in one pane?
>>
>> > Hello guys,
>> > Thanks a lot for your help! I chose Steve's suggestion and it works
>> > great. However I noticed a possible inconsistency when I extended that
>> > version: My
>> > original Plot-Statement was
>> >
>> > Plot( C, "close", IIf( Rs, colorGreen, IIf( Fs, colorRed, colorBlack )),
>> > StyleCandle);
>> >
>> > Now I modified Steve's suggestion a bit like this::
>> >
>> > if ( LastValue( Cum( High ) ) == LastValue( Cum( Low ) ) )
>> >    Style = styleLine AND
>> >    Color = colorBlack;
>> > else
>> >    Style = styleCandle AND
>> >    Color = IIf( Rs, colorGreen, IIf( Fs, colorRed, colorBlack ));
>> >
>> > Plot( C, "close", Color, style);
>> >
>> > The first Color statement (for line charts) works perfect, but for the
>> > second
>> > Color statement (for candlecharts) I get the following error:
>> >
>> > Error 5.
>> > Argument #4 has incorrect type (the function expects different argument
>> > type
>> > here)
>> >
>> > Isn't that strange, given the fact that the second Color statement was
>> > included in the original Plot() where it worked flawlessly?
>> >
>> > Greetings,
>> > Thomas
>> >
>> >
>> > 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>> > http://www.amibroker.com/devlog/
>> >
>> > For other support material please check also:
>> > http://www.amibroker.com/support.html
>> >
>> > Yahoo! Groups Links
>>
>> 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>> http://www.amibroker.com/devlog/
>>
>> For other support material please check also:
>> http://www.amibroker.com/support.html
>>
>> Yahoo! Groups Links
>>
>>
>>
>
>
> 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
> Yahoo! Groups Links
>
>
>
>
> 



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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/
 


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.21/589 - Release Date: 12/15/2006 5:10 PM