PureBytes Links
Trading Reference Links
|
Dennis- There are two ways that I know of. Let's say you're going
long and want to exit after 5 bars.
1. This exits after 5 bars and removes redundant signals.
Buy = Your buy code here;
Buy = ExRemSpan( Buy, 5 );
Sell = Ref( Buy, -5 );
2. This is a 5 bar stop.
ApplyStop( stopTypeNBar, stopModeBars, 5 );
#1 will work when backtesting and doing an exploration. #2 works when
backtesting but if you want to use it for an exploration you need to
add another line: Equity(1);
Be careful when adding Equity(1) after ExRemSpan. For some reason it
can negate an X bar exit in certain cases. I'm not sure why. In any
event, I strongly recommend that you test your code to make sure
you're getting what you want.
Mark
--- In amibroker@xxxxxxxxxxxxxxx, "Dennis" <Dennis.Metz@xxxx> wrote:
> Hi
>
> Is it possible to use timestops, i.e. exit after x days?
>
> Best regards,
> Dennis
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/CNxFAA/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/
|