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

Re: [amibroker] SetBarsRequired doesn't prevent trades before then?



PureBytes Links

Trading Reference Links

Dave,

It is quite easy then. Just filter buy/short signals this way:

OkToTrade = BarIndex() > 300; // start trading when there are 300 bars available

Buy = .. your rule
Short = ... your rule

Buy = OkToTrade AND Buy;
Short = OkToTrade AND Short;


As for SetBarsRequired: as written in the guide: it is relevant to INDICATOR formulas
that use either 3rd party DLLs or parts in script when QuickAFL is enabled.
What is QuickAFL is described in the User's Guide, just do search for QuickAFL.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Dave Merrill" <dmerrill@xxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, October 18, 2003 10:00 PM
Subject: RE: [amibroker] SetBarsRequired doesn't prevent trades before then?


> sorry I wasn't clear. I know that I can control the time range of the
> analysis.
> 
> but say I test a watchlist of stocks, each of which has data starting from a
> different date. I was looking for a way to tell AB not to trade any stock
> until it has at least a minimum amount of history before then. and I know
> how to code that in other ways too, with my own logic.
> 
>  it's just that I thought SetBarsRequired did this, and if that's not what
> it does, what *does* it do?
> 
> thanks,
> 
> dave
> 
> 
> > To control when trades happen use "From" - "To" settings in AA window.
> >
> > As for what SetBarsRequired is for see the user's guide
> > http://www.amibroker.com/guide/afl/afl_view.php?name=SETBARSREQUIRED
> >
> >
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message -----
> > From: "Dave Merrill" <dmerrill@xxxxxxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Saturday, October 18, 2003 9:45 PM
> > Subject: [amibroker] SetBarsRequired doesn't prevent trades before then?
> >
> >
> > > if I call SetBarsRequired(252 * 3, -1) right at the top of my AA code, I
> > > thought that would tell AB that this code needs at least 3
> > years worth of
> > > history to act, so no trades should be taken before then. it doesn't do
> > > that; trades happen immediately at the start of the AA range anyway.
> > >
> > > I know I can suppress those trades myself, but I don't understand the
> > > intended use of SetBarsRequired if this isn't it.
> > >
> > > dave
> > >
> > >
> > >
> > > Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> > > Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> > > -----------------------------------------
> > > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > > --------------------------------------------
> > > Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >
> >
> 
> 
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> 
> 
> 
> 
> 
> 
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
> 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/mk9osC/hP.FAA/3jkFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/