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

[amibroker] Re: Help undestanding Arrays



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, "laster" <laster@xxx> 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;
> 
> }
> 
> }
>




Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.27/517 - Release Date: 11/3/2006