Good idea. When you figure out how to do that real-time, I would appreciate seeing the code ;-)

 

--

Terry

-----Original Message-----
From:
[email protected] [mailto:[email protected]] On Behalf Of laster
Sent: Sunday, October 15, 2006 07:08
To:
[email protected]
Subject: RE: [amibroker] Help understanding Arrays

 

Buy High sell Low. Why not? J

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Terry
Sent: Saturday, October 14, 2006 23:47
To: [email protected]
Subject: RE: [amibroker] Help understanding Arrays

 

The thing you are missing in the below is you have FORGOTTEN to use the subscript in your loop, thus you are setting the ENTIRE ARRAY to True. The last line of your loop should look like this and it will do what you are expecting.

 

            {

            Buy[i] = H[i];

}

 

Actually, this is technically incorrect because, as Fred said, Buy is a light switch, either 0 or 1. This sets Buy to the High. However it still works because Amibroker treats ANY NON-ZERO Number as true, even a negative one.

 

PS: I hope you are taking Fred's advice about not buying at the high ;-)

--

Terry

-----Original Message-----
From: [EMAIL PROTECTED]ps.com [mailto:[EMAIL PROTECTED]ps.com] On Behalf Of laster
Sent: Saturday, October 14, 2006 11:21
To: [EMAIL PROTECTED]ps.com
Subject: [amibroker] Help undestanding Arrays

 

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






SPONSORED LINKS
Software support Small business finance Business finance online
Business finance training Business finance course

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to