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

Re: [amibroker] Barsince used twice in a row.



PureBytes Links

Trading Reference Links

TD2=IIf(BarsSince(BarsSince(TD1))==Opt1, 1,0);

the only thing I can think of is that by default something not
specified with a value is one
using this premise, re-write the line
TD2=IIf(BarsSince(BarsSince(TD1)  ==1  )==Opt1, 1,0);

this could just be written as
TD2=IIf(BarsSince( ref(TD1,-1) )==Opt1, 1,0);
or
TD2=IIf(BarsSince(TD1)==Opt1+1, 1,0);
assuming this is true it could be simplified even further
TD2= BarsSince(TD1)==Opt1+1;


Ifnot that then got me stumped


On 9/11/05, Techguy <forex_bots@xxxxxxxxxxx> wrote:
> I'm having problems comprehending this double BarsSince statement from
> the TD Sequential script:
> 
> /***********SetupSell************/
> TD1=IIf(Close>Ref(Close,-4),1,0);
> TD2=IIf(BarsSince(BarsSince(TD1))==Opt1, 1,0);
> TD3= Ref(L,-1)<=Ref(HHV(H,Opt1-4),-3);
> TD4= Ref(C,-Opt1)<=Ref(C,-Opt2);
> SetupSell= TD3 AND TD2 AND TD4 ;
> 
> Could someone explain why BarsSince is used twice?
> 
> Thanks,
> 
> 
> 
> 
> 
> 
> 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
> 
> 
> 
> 
> 
> 
> 
> 


-- 
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Put more honey in your pocket. (money matters made easy).
http://us.click.yahoo.com/r7D80C/dlQLAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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/