PureBytes Links
Trading Reference Links
|
Hey all,
> Hello
> Walt was kind enough to provide me with the following code - I hope he
> doesn't mind if I share it around. This is something you can try, and
> maybe you can adapt it if it isn't providing exactly what you need.
> Basically, it takes care of the trailing stop which kicks in after
> *MinGainPct* amount of profit has been reached. The trailing stop will
> close the position after *trailPct* of the profit beyond the *MinGainPct
> *profit has been given back I think you have to set up the hard stop
> 'behind the entry' separately, but that shouldn't be a problem.
>
> buyat=BuyPrice;
> MinGainPct=.04;
> trailPct=15;
> pct=IIf((MA(C,2)-buyat)/buyat > MinGainPct,trailPct,9999);
> ApplyStop(stopTypeTrailing,stopModeRisk,pct,1,True);
Being a newbie, i'm a little confused by this. Why are MinGainPct and
trailPct not expressed in the same manner? Does .04 signify 4%? If so,
why not express it as a whole number like trailPct?
Also, does trailPct signify the % amount you allow to retrace before
exiting?
Thanks,
Andrew.
------------------------ Yahoo! Groups Sponsor --------------------~-->
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~->
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/
|