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

[amibroker] Re: Plot Applystop



PureBytes Links

Trading Reference Links




>>I had a look at ApplyStop in 
the manual and at the bottom of the page it 
>>has:>>ApplyStop( stopTypeTrailing, stopModePoint, 
2*ATR(10), True, True );>>Equity(1); // THIS EVALUATES 
STOPS>>Plot(Sell=4,"ApplyStop 
Sell",colorRed,1|styleOwnScale);>>I placed the above in the 
indicator builder but doesn't seem to work.>>Sorry if this is a 
really basic question, but I have looked through the >>manual. Maybe I 
have to take off my Metastock head ! :-)>>Cheers, 
Glenn
Glenn,
 
Try the following code in IB, where my TrailStop == your 
 2*ATR(10)
//#### Your buy rules here ####<FONT face=Arial 
size=1>
Sell = <FONT face=Arial color=#ff00ff 
size=2>0; 
<FONT 
size=2>ApplyStop<FONT 
size=2>(stopTypeTrailing, stopModePoint, TrailStop, True, 
True);
e = <FONT 
size=2>Equity(<FONT 
face=Arial color=#ff00ff>1<FONT face=Arial 
size=2>);            
                
                
                
                 
//Creates equivalent 
of a back test
GraphXSpace =<FONT face=Arial 
color=#ff00ff>5; <FONT 
color=#008000>            
                
                
                
        <FONT face=Arial 
color=#008000 size=1>//Allow space at top and bottom of 
chart
<FONT 
size=2>Plot<FONT 
face=Arial>(Close,"Long 
System",colorGreen,<FONT face=Arial 
color=#ff00ff>64); <FONT 
color=#008000>            
                
    <FONT 
size=2>//Plot a basic candlestick chart<FONT face=Arial 
size=1>
StopLoss =<FONT face=Arial 
color=#0000ff>Min<FONT 
face=Arial>(<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<FONT face=Arial 
size=2>)-TrailStop,Open); <FONT face=Arial color=#008000 
size=1>//Define Applystop level<FONT face=Arial 
size=1>
<FONT 
size=2>Plot<FONT 
face=Arial>(StopLoss,"Stop 
Loss",colorRed,<FONT face=Arial 
color=#ff00ff>1); <FONT 
color=#008000>            
                
        <FONT face=Arial 
color=#008000>//Plot Applystop Level
 
<FONT 
color=#000000> 
Please note 
that this stop is volatile and using ATR(10) will show 
up
with an up 
& down trail stop.  Using a longer period for ATR will 
smooth
out the up 
and down.
<FONT 
color=#000000> 
<FONT 
color=#000000>Regards,
<FONT 
color=#000000> 
<FONT 
color=#000000>Tony






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.