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

[amibroker] Re: Exit on first profitable open



PureBytes Links

Trading Reference Links

The example I provided would of course be for same day trading on the 
buy side ... If what you want is delayed a bar because you are buying 
on the Open of the following bar then it would be one bar less i.e.

Sell = O > Ref(O, -(BSB - 1));

If this doesn't work for you then you need to be more specific about 
exactly what is happening and how that compares with what you are 
after.


--- In amibroker@xxxxxxxxxxxxxxx, "Peter" <pa299@xxxx> wrote:
> Fred
> Thanks but been there. 
> As I understand it BarsSince(Buy); will return the bars to the last 
Raw
> buy signal. You may have the actual Buy entry then one or more 
other buy
> signals which are ignored ( assuming you include the line
> Buy=ExRem(Buy,Sell);) then the sell signal. BarsSince(Buy); will 
return
> the bars to last Buy signal not the one where you entered the 
trade. 
> That's the bit I can't solve.
> Peter
> 
> 
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] 
On
> Behalf Of Fred
> Sent: Tuesday, 9 August 2005 7:38 a.m.
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Exit on first profitable open
> 
> Assuming you have an impulse type buy i.e. 
> 
> Buy = Cross(X, Y);
> 
> then ... 
> 
> BSB = BarsSince(Buy); 
> 
> ... should give you how many bars it's been since the buy 
occured ... 
> 
> Then assuming that you also bought at an opening ... then ...
> 
> Sell = O > Ref(O, -BSB);
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Peter" <pa299@xxxx> wrote:
> > Hi
> > After spending a huge amount of time trying to code an `Exit on 
the 
> > first profitable open' I give up. 
> > Is anyone willing to share the code for what should be a very 
simple 
> > exit?????
> > 
> > Any help would be appreciated!!
> > Peter
> 
> 
> 
> 
> 
> 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 other support material please check also:
> http://www.amibroker.com/support.html
> 
>  
> Yahoo! Groups Links




------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h89jr1r/M=362131.6882500.7825259.1493532/D=groups/S=1705632198:TM/Y=YAHOO/EXP=1123545511/A=2889190/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Put more honey in your pocket. (money matters made easy) Welcome to the Sweet Life - brought to you by One Economy</a>.</font>
--------------------------------------------------------------------~-> 

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

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