Buy is like a light switch ... On or Off, it is NOT a methodology to 
take action at a price ...

Buy = H ... Tells AB to Buy on EVERY BAR at the HIGH of that Bar ... 
Why ? ... because BUY and H are arrays ...

Although incorrect ... If you had said ... Buy[i] = H[i]; ... The buy 
would probably have occured on the bar you wanted it to i.e. the same 
one where the cross occured ... but NOT at the High ... For Buys to 
occur at specific points you need to use the BuyPrice Array ... 

PS ... Buying at the H or L price of the current bar is never a good 
idea because these are unknown until the bar is no longer current.


--- In [email protected], "laster" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> Still trying to figure out working with Arrays, and it's apparent 
there is
> something I am not getting.
> 
> My understanding of the following is: If in the i bar the cross of 
the MACD
> was true, then Buy at the High. However, Amibroker is buying in 
several
> circumstances (including when the condition is true).
> 
> Can somebody smarter than me please translate the following formula 
into
> English so I can finally get it?
> 
> Thanks a lot again,
> 
> Jerry
> 
>  
> 
>  
> 
> Reason= Cross( MACD(12,26), Signal(9) );
> 
> for( i = 0; i < BarCount; i++ ) 
> 
> {
> 
> if (Reason[i] == True)
> 
>             {
> 
>             Buy = H;
> 
> }
> 
> }
>





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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

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

Reply via email to