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

[amibroker] Defining a specific Exit Price



PureBytes Links

Trading Reference Links

Hello All (again....)

I'm struggling to solve a coding problem with regard to exits and would 
very much welcome some advice.

I'm using a trailing stop and currently wait for price to fall below it 
to signal the exit to a long position. My code is: 

Sell =  C < Ref(stop, -1);

At the moment the sell price is defined as the open for the following 
period. I have not added any additional code for this so assume this is 
the default setting.

However, what I actually want to do is to use the value of the trailing 
stop on the period BEFORE the exit was signalled.

As this is a weekly system, my logic behind this is that I will set the 
exit price based on the trailing stop once a week in advance. As soon 
as this level is breached my position will be closed at this value 
(give or take some slippage).

I accept that this idea could result in the price dipping below the 
trailing stop value and then rising again causing me to be stopped out 
of the trade prematurely, but I am willing to accept that risk.

My question is how can I code this?  I have tried a few ideas including 
SellPrice = Ref(stop, -1); but nothing seems to work.

Any ideas???

Thanks in advance,

Chorlton





Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html
 
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:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto: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/