PureBytes Links
Trading Reference Links
|
<FONT
size=2>Ken,
I have not followed the whole thread but the
following code excerpts can plot a line
while using the noted format of
ApplyStop.
Keep in mind that due to the last parameter of
ApplyStop, the stop loss point can
trail up and down. The long ATR period
tends to keep that in check.
Regards,
Tony
LY = <FONT face=Arial
color=#0000ff>Optimize(<FONT
face=Arial color=#ff6820>"ATR Period"<FONT face=Arial
color=#800080>,40<FONT face=Arial
color=#800080>,40<FONT face=Arial
color=#800080>,40<FONT face=Arial
color=#800080>,1<FONT face=Arial
color=#800080>);
LZ = <FONT
face=Arial color=#0000ff>Optimize<FONT face=Arial
color=#800080>("Stop
Multiplier",<FONT face=Arial
color=#ff00ff>4,<FONT face=Arial
color=#ff00ff>4,<FONT face=Arial
color=#ff00ff>4,<FONT face=Arial
color=#ff00ff>1);
TrailStop = <FONT face=Arial
color=#0000ff>Ref(<FONT face=Arial
color=#0000ff>ATR(LY) * LZ,-<FONT
face=Arial color=#ff00ff>1<FONT face=Arial
color=#800080>);
ApplyStop<FONT
face=Arial color=#800080>(stopTypeTrailing<FONT
face=Arial color=#800080>, stopModePoint<FONT
face=Arial color=#800080>, TrailStop, True<FONT
face=Arial color=#800080>, True<FONT
face=Arial color=#800080>);<FONT face=Arial
color=#800080>
StopLoss =<FONT face=Arial
color=#0000ff>Min(<FONT face=Arial
color=#0000ff>HighestSince(<FONT
face=Arial>Buy==<FONT face=Arial
color=#ff00ff>1,<FONT
face=Arial>High,<FONT face=Arial
color=#ff00ff>1)-TrailStop,<FONT
face=Arial>Open);
<FONT face=Arial
color=#0000ff>Plot(StopLoss,<FONT
face=Arial color=#ff6820>"Stop Loss"<FONT face=Arial
color=#800080>,colorRed<FONT face=Arial
color=#800080>,1<FONT face=Arial
color=#800080>);
>I tried your
code, but it does not seem to work. I plotted “stoploss” and even
“C-stoploss” but it does not seem to do what is intended. I have a long
only system, so >first added Short = 0; then changed to BarsSince(Sell) but
can not make it do anything. No errors, just the plots look
screwy.The concept is
important and valid. I just >must not be applying it correctly. I
will play with it some more because I am at the point in my system development
where I will be testing stops, and the concept of >what you are talking about
is important.
<FONT face=Arial color=navy
size=2>>Ken
Yahoo! Groups Sponsor
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|