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

[amibroker] Re: Plot Applystop



PureBytes Links

Trading Reference Links

Tony,

Thanks for your help, makes it much clearer now how to setup a chart, 
but using the following the ATR stop isn't on the chart?

------------------------------------------------
Buy = Cross( MA( Close, 30 ), MA( Close, 50 ) );
Sell = 0;
ApplyStop( stopTypeTrailing, stopModePoint, 2*ATR(10), True, True);
e = Equity(1);
GraphXSpace =5;
Plot(Close,"Long System",colorBlack,128);
StopLoss =Min(HighestSince(Buy==1,High,1)-2*ATR(10),Open);
Plot(StopLoss,"Stop Loss",colorRed,1);
------------------------------------------------

Cheers Glenn

--- In amibroker@xxxxxxxxxxxxxxx, "Tony/Dianne" <awenos@xxxx> wrote:
> >>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 ####
> Sell = 0; 
> ApplyStop(stopTypeTrailing, stopModePoint, TrailStop, True, True);
> e = Equity
(1);                                                                  
           //Creates equivalent of a back test
> GraphXSpace 
=5;                                                                   
  //Allow space at top and bottom of chart
> Plot(Close,"Long 
System",colorGreen,64);                                 //Plot a 
basic candlestick chart
> StopLoss =Min(HighestSince(Buy==1,High,1)-TrailStop,Open); //Define 
Applystop level
> Plot(StopLoss,"Stop 
Loss",colorRed,1);                                     //Plot 
Applystop Level
> 
> 
> 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.
> 
> Regards,
> 
> Tony


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 http://docs.yahoo.com/info/terms/