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

[amibroker] Re: How To Plot Long And Short Stop Alternately On One Chart?



PureBytes Links

Trading Reference Links


Thanks, Joseph. This basically solves my problem. I've just tried to
set colour to "Null" instead of the "background colour" but it looks
like "Null" is not allowed in this particular situation. Any comment
on this, anyone?

This code includes "Null" in the plot statement and it doesn't work
right:

LongSignal = C > ( LLV( L, 20 ) + 2 * ATR( 10 ) );
ShortSignal = C < ( HHV( H, 20 ) - 2 * ATR( 10 ) );
DynamicColour = IIf( LongSignal, colorLime, colorRed);

TrailingStopLong = HHV( C - 2 * ATR(10), 15 );
TrailingStopShort = LLV( C + 2 * ATR(10), 15 );

Plot( TrailingStopLong, "", IIf( LongSignal, 38, Null), 512 );
Plot( TrailingStopShort, "", IIf( ShortSignal, 53, Null), 512 );

Title = Name()+" \\c11"+Interval(format=2)+" "+Date()+"\\c-1 C="+C;
Plot( Close, "", DynamicColour, 64 );
SetChartOptions(0, chartShowDates);

/****/
The code below works OK. It uses "background colour" in the plot
statement instead of "Null" (for white background use "55" as is, for
black background  replace "55" with "16"):

LongSignal = C > ( LLV( L, 20 ) + 2 * ATR( 10 ) );
ShortSignal = C < ( HHV( H, 20 ) - 2 * ATR( 10 ) );
DynamicColour = IIf( LongSignal, colorLime, colorRed);

TrailingStopLong = HHV( C - 2 * ATR(10), 15 );
TrailingStopShort = LLV( C + 2 * ATR(10), 15 );

/* Iif(..., ..., white background: 55 / black background: 16) */
Plot( TrailingStopLong, "", IIf( LongSignal, 38, 55), 512 );
Plot( TrailingStopShort, "", IIf( ShortSignal, 53, 55), 512 );

Title = Name()+" \\c11"+Interval(format=2)+" "+Date()+"\\c-1 C="+C;
Plot( Close, "", DynamicColour, 64 );
SetChartOptions(0, chartShowDates);


Lesmond

-----------------
--- In amibroker@xxxxxxxxxxxxxxx, "J. Biran" <jbiran@xxxx> wrote:
> Instead of 
> IIf( LongSignal, Plot( TrailingStopLong, "", 38, 512 ), Plot(
> TrailingStopShort, "", 53, 512 ));
> 
> 
> You could try 2 separate plot commands where in each the color is
> either your choice when TRUE
> or the background color when FALSE 
> 
> Joseph Biran






------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/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/