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

Re: [amibroker] Bar concepts and formula execution help



PureBytes Links

Trading Reference Links

Hi, first, the buy and sell signals are just simple crosses (not my real signals). That is not what I need help on. If you take the code you responded back with, and put that on the chart, the arrow would come on and off as the price moved up and down IN THE SAME BAR. That is my issue. If I send my buy order to the IB controller, it is live. I can't have the signal coming on and off multiple times per bar - I need the buy arrow pointing to the price the signal came on at and NOT moving around, or coming off completely. Please read my original post below.
 
I very much appreciate the help.
 
Thanks.
 
Mark
-----amibroker@xxxxxxxxxxxxxxx wrote: -----

To: amibroker@xxxxxxxxxxxxxxx
From: Graham <kavemanperth@xxxxxxxxx>
Sent by: amibroker@xxxxxxxxxxxxxxx
Date: 01/24/2006 04:46PM
Subject: Re: [amibroker] Bar concepts and formula execution help

I am not certain what all the fruit does in your code, but here is all
you need for this particular system


Buy = Cross( Close, EMA(Close,9) );
Sell = Cross( EMA(Close,9), Close );
Short  = Sell;
Cover  = Buy;
GraphXSpace=10;
Plot(C,"Close",colorWhite,styleLine);
Plot(EMA(C,9),"Close",colorRed,styleLine);

   PlotShapes( Buy*shapeUpArrow, colorWhite ,0,C,-15 );
   PlotShapes( Sell*shapeSmallDownTriangle, colorWhite,0,C,-25 );
   PlotShapes( Short*shapeDownArrow, colorBrightGreen, 0,C, -15 );
   PlotShapes( Cover*shapeSmallUpTriangle, colorBrightGreen ,0,C,-25 );


--
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, Tomasz Janeczko <amibroker@xxxxxx> wrote:
> Hello,
>
> First please read "Understanding AFL":
> http://www.amibroker.com/guide/h_understandafl.html
>
> Shortly in Tradestation your code is executed NumberOfBars times.
> In AFL your code is executed ONCE only (hence it is a LOT faster)
> immediatelly for all bars (via array processing).
>
> You can however calculate on bar-by-bar basis if you want in
> AFL using 'for' loop
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message -----
> From: "clarusinnovation" <mfishburn@xxxxxxxxxxxxxxxxxxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Tuesday, January 24, 2006 4:59 AM
> 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