PureBytes Links
Trading Reference Links
|
A couple of things to remember
barindex() starts from 0 at the first bar (oldest) of your database
and counts up from there to the end (most recent) of the database.
Bacount is the total number of bars in the database, but Barcount-1 is
the last barindex() value
If you are using certain bar functions like loops in a chart then you
often need to voercome the amibroker method of faster chart drawing,
where it uses the least number of bars to calculate what shows on the
screen. Using Setbarsrequired function allows this behaviour to be
overridden and all the bars in the array can be used.
If you have a function as part of a buy or sell condition that dows
not get its first value until the number of bars is met (periods in
the function eg MA(C,10) is 10 bars to get first MA value) the you
could be required to tart the loop after this minimum number of bars
for( i=10;i<barcount;i++)
--
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
On 1/24/06, cstrader <cstrader232@xxxxxxxxxxxx> wrote:
> Try putting this line as the first line of your code:
>
> Setbarsrequired(10000, 10000);
>
> This might help with your problem of not all of the bars being shown in the
> _trace.
>
> The problem of signals coming and going within a bar is not real clear to
> me. You have to remember that, unless you are looping, AFL works with
> arrays. I think TS does not and it may take you a while to get used to them
> (in the end you'll be happy you did). Array actions that occur on later
> bars can indeed change things on earlier bars.
>
> I think you might need to post some of your code.
>
>
>
> ----- Original Message -----
> From: "clarusinnovation" <mfishburn@xxxxxxxxxxxxxxxxxxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Monday, January 23, 2006 10:59 PM
> Subject: [amibroker] Bar concepts and formula execution help
>
>
> > Hi,
> >
> > I am struggling with the concepts of bars. I am a Tradestation convert
> > to Ami. In Tradestation when I applied a new indicator, or system, the
> > code would execute from Bar 0 to the latest bar (say 1500). Each bar
> > would be like a new bar until bar 1500 is reached. How does this work
> > in Ami.
> >
> > When I apply an indicator in Ami, things get plotted, but I don't get
> > how the bar index is being used. I have put up DebugView and have
> > tried to _TRACE with print outs, but it doesn't start from bar 0 to
> > the latest bar....
> >
> > I need to understand that concept.
> >
> > I need to have a buy come on once in a bar. sometimes my conditions go
> > on or off in the bar and the arrow shows up and then disappears. I
> > can't have that if I have transmitted the order and it got filled. So,
> > if buy comes on, I want to leave it on until I get a new bar and then
> > it is a new ball game.
> >
> > I know you can help me with the indicator, but please help me think
> > and figure out how this thing works.
> >
> > Thanks a lot.
> >
> > Mark
> >
> >
> >
> >
> >
> >
> >
> > 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
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
>
> 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 --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/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/
|