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

Re: [amibroker] Help needed: time dependent stop



PureBytes Links

Trading Reference Links

Hi, actually not - at least I don't think.... to make it more precise, the problem is the following:

(1) I want a stop to be placed after n-days in a trade. I tried the following:

Buy = C > EMA(C, 10);
Buy = ExRem(Buy, Sell);
Sell = BarsSince(Buy) > 5 AND C < Ref(C, -BarsSince(Buy));	
Sell = ExRem(Sell,Buy);

So there is a stop loss at entry after 5 days, but it didn't work.

(2) Linked to the above is an exit strategy similar to the Bollinger Bandit. I want to have something along the lines:

Sell = C < EMA(C, Max(50 - DaysInTrade, 10))

Any ideas how to code this without loops?

Thanks
J



--- reinsley <reinsley@xxxxxxxx> schrieb am Sa, 7.11.2009:

> Von: reinsley <reinsley@xxxxxxxx>
> Betreff: Re: [amibroker] Help needed: time dependent stop
> An: amibroker@xxxxxxxxxxxxxxx
> Datum: Samstag, 7. November 2009, 9:20
> 
> Are you looking for that ?
> 
> http://www.amibroker.com/guide/afl/afl_view.php?id=50
> 
> Best regards
> 
> jens_lueckhof a écrit :
> >  
> > 
> > Hi, I am struggeling implementing the following:
> > 
> > After x days of a trade I want to place a protective
> stop at the entry.
> > So if the trade hasn't been profitable, I close it.
> > 
> > I have tried with BarsSince(Buy) and ValueWhen( Buy,
> C, 1), but this 
> > doesn't work.
> > 
> > Anyone here who can give me a hand?
> > 
> > Many thanks
> > J
> > 
> > 
> 
> 
> 
> ------------------------------------
> 
> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
> 
> TO GET TECHNICAL SUPPORT send an e-mail directly to 
> SUPPORT {at} amibroker.com
> 
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
> 
> For NEW RELEASE ANNOUNCEMENTS and other news always check
> DEVLOG:
> http://www.amibroker.com/devlog/
> 
> Yahoo! Groups Links
> 
> 
>     amibroker-fullfeatured@xxxxxxxxxxxxxxx
> 
> 
> 


      


------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/