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

Re: [amibroker] A More Efficient Way?



PureBytes Links

Trading Reference Links

OK, I admit I have read too fast :-(
Corrected formula is:

Buy = MA( Close, 25 ) > MA( Close, 75 ) AND Ref( Sum( MA( Close, 25 ) < MA( Close, 75 ), 10 ) , -1 ) == 10;

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Tomasz Janeczko" <amibroker@xxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, July 01, 2005 11:00 AM
Subject: Re: [amibroker] A More Efficient Way?


> Hello,
> 
> Yes, it is single-liner without even needing to write a loop:
> 
> Buy = Sum( MA( Close, 25 ) > MA( Close, 75 ), 11 ) == 11;
> 
> (note that in your code you are checking 11 days, not 10, because
> it is TODAY PLUS 10 days back)
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "ldriker" <leoker@xxxxxxxxxxxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Thursday, June 30, 2005 11:22 PM
> Subject: [amibroker] A More Efficient Way?
> 
> 
>> Following is a simple buy signal premised upon the 25 day simple 
>> moving average just having crossed above the 75 day simple moving 
>> average coupled with the 25 day simple moving average being below 
>> the 75 day simple moving average for each of the last 10 days.
>> 
>> How might this code be written more efficiently?
>> 
>> Buy = MA( Close, 25 ) > MA( Close,75 )  AND
>> MA( Ref( Close, -1 ), 25) < MA( Ref( Close, -1 ), 75 )  AND
>> MA( Ref( Close, -2 ), 25) < MA( Ref( Close, -2 ), 75 )  AND
>> MA( Ref( Close, -3 ), 25) < MA( Ref( Close, -3 ), 75 )  AND
>> MA( Ref( Close, -4 ), 25) < MA( Ref( Close, -4 ), 75 )  AND
>> MA( Ref( Close, -5 ), 25) < MA( Ref( Close, -5 ), 75 )  AND
>> MA( Ref( Close, -6 ), 25) < MA( Ref( Close, -6 ), 75 )  AND
>> MA( Ref( Close, -7 ), 25) < MA( Ref( Close, -7 ), 75 )  AND
>> MA( Ref( Close, -8 ), 25) < MA( Ref( Close, -8 ), 75 )  AND
>> MA( Ref( Close, -9 ), 25) < MA( Ref( Close, -9 ), 75 )  AND
>> MA( Ref( Close, -10 ), 25) < MA( Ref( Close, -10 ), 75 )
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 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
> 
> 
> 
> 
> 
> 
> 
>


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/