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

Re: [amibroker] Re: Modifying delay and getting the exit price right



PureBytes Links

Trading Reference Links


Replying to my own post, hoping like heck someone can offer further help:

On Wed, 2 Feb 2005 07:40:53 +0900, Rigged Game <riggedgame@xxxxxxxxx> wrote:
> Thanks for taking the time to reply, Chris.
> 
> On Tue, 01 Feb 2005 17:53:27 -0000, Christoper <turkey@xxxxxxxxxxxxxxx> wrote:
> >
> > > I'd like to compare my current results with the
> > > results of exiting at the close on the day after entry (bar 2 close
> > > instead of bar 3 open), but ONLY if the close on that second bar is
> > > less than my Buyprice from the first bar.
> >
> > So basically you are gonna run 2 backtests right? One for 3-bar stop,
> > and a second for the 2/3-bar stops.
> 
> Yes, this is exactly what I want to do.  The first test, on 3-bar
> trades, works correctly.  The second test, involving some 2-bar and
> some 3-bar trades, I cannot figure out.  As I mentioned, the 3-bar all
> exit on the Open, in both cases, while the 2-bar would exit on the
> Close.
> 
> > > I am not sure exactly how to go about doing this.  I thought I could
> > > use a conditional IIF to set the delay.  For example: IIF(Ref(C,1) <
> > > Buyprice, delay = 1, delay = 2).  Then I thought I would do
> > something
> > > like: IIf(delay = 1, SellPrice = Close, SellPrice = Open).
> >
> > To setup the 2/3-bar stops, I wouldn't modify the delay.  I would
> > leave the applystop as is, and just create a new Sell statement.
> > Maybe someone else can think of something more elegant.
> >
> > Something like:
> > NewStop = BarsSince(Buy) == 2 AND C < Ref(O, -2);
> > Sell = [your stuff];
> > Sell = Sell OR NewStop;
> 
> Can I do that?  I thought that when using ApplyStop it was necessary
> to set Sell = 0.  So that is how I have it right now.  I am really
> lost I guess.





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