why don't you just use SetTradeDelays(0,0,0,0)  and then if you want a delay
add it in your code?

d

On Sat, Aug 16, 2008 at 10:09 PM, Pete <[EMAIL PROTECTED]> wrote:

> I spent some more time trying to work this out and could not find some
> way to verify if this is working. However, I found a much less complex
> method to apply this technique (see code below), but I still cannot
> get it to do what I expect. Example: comment out the line of code for
> the SetTradeDelays and run the back test. I get slightly different
> results but when I drill down into individual trades the exits are
> occurring on the day of the signal whether the line of code in place
> or commented out.
>
> //[code]*************************************************
> SetTradeDelays(0,0,0,0);
> BuyPrice = Open;
> SellPrice = Open;
>
> Buy = <<insert buy rule here>>
> fltr = <<some test value to see if delays should be adjusted>>
>
> tstDly = WriteIf(fltr == 1 , "1", "0");
> SetTradeDelays(0, 0, StrToNum(tstDly) , StrToNum(tstDly) );
>
> sell = <<insert sell rule here>>
> //[/code]************************************************
>
>  Pete  :-)
>
> --- In [email protected], "Pete" <[EMAIL PROTECTED]> wrote:
> >
> > Just wondering if this is even possible. I checked the AFL help files,
> > searched the online AFL Formula reference and also searched this yahoo
> > group. Every example only shows the SetTradDelays() function being
> > used one time in the code and never 'adjusted' to some other value
> > based on a condition. I created this function which seems to me should
> > work correctly but I have no way to really be sure it's working as
> > designed. I am using the printf() function several times to keep track
> > of different values during bar replay, (thanks to Razzbarry), but I
> > can't find a way to print the values of the trade delays to the output
> > window.
> > //[code]*************************************************
> > SetTradeDelays(0,0,0,0);
> > BuyPrice = Open;
> > SellPrice = Open;
> >
> > Buy = <<insert buy rule here>>
> > fltr = <<some test value to see of delays should be adjusted>>
> > function dly()
> > {
> >       if (fltr == 1)
> >       SetTradeDelays(0,0,1,1);
> >       else
> >       SetTradeDelays(0,0,0,0);
> > }
> > sell = <<insert sell rule here>>
> > //[/code]************************************************
> >
> > The goal here is to change the trade delays to 0,0,1,1 only if the
> > fltr variable returns a true value of 1.
> > Thanks for taking the time to check this out.
> >
> >   Pete  :-)
> >
>
>
>
> ------------------------------------
>
> 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
>
>
>
>

Reply via email to