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
____________________________________________
From: Lesmond V
[mailto:ebsn247@xxxxxxxx]
Sent: Tuesday, April 12, 2005
12:38 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] How To Plot
Long And Short Stop Alternately On One Chart?
Here is the simple ATR-based system.
I can't figure out how to plot the line for the
"TrailingStopLong"
only when the candles are green
("LongSignal") and the line for the
"TrailingStopShort" only when the
candles are red ("ShortSignal").
With the code below the lines for both stops are
plotted together all
the time.
Help appreciated
Lesmond
-------
LongSignal = C > ( LLV( L, 20 ) + 2 *
ATR( 10 ) );
ShortSignal = C < ( HHV( H, 20 ) - 2 * ATR( 10
) ); //this variable
is not in use in this test
DynamicColour = IIf( LongSignal, colorLime,
colorRed);
TrailingStopLong = HHV( C - 2 * ATR(10), 15 );
TrailingStopShort = LLV( C + 2 * ATR(10), 15 );
IIf( LongSignal, Plot( TrailingStopLong,
"", 38, 512 ), Plot(
TrailingStopShort, "", 53, 512 ));
Title = Name()+"
\\c11"+Interval(format=2)+" "+Date()+"\\c-1
C="+C;
Plot( Close, "", DynamicColour, 64 );
SetChartOptions(0, chartShowDates);
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
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