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

Re: [amibroker] Moving average gradient



PureBytes Links

Trading Reference Links

Your second Buy statement overwrites the first. You should just combine them

Buy = Gradient > GradientB
AND BarsSince(MA(C,3) - Ref(MA(C,3),-1) < 0) <= 3
AND H > Ref(HHV(H,1),-1)
AND  Open > Ref( Low , -1 );

also as a side note
H > Ref(HHV(H,1),-1)
is same as
H > Ref(H,-1)

-- 
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com



2008/7/12 tridean34 <tridean34@xxxxxxxxx>:
> Hi All,
> Could someone let me know where I'm going wrong.
>
> This system is supposed to go long when certain criteria are met but
> it's making trades while the criteria is not present.
>
> The 200 day moving average is supposed to be greater than the 200 day
> moving average from 50 days ago by a factor of 5 times the ATR (200).
>
> Then there is to be a negative gradient in the 3 day moving average
> within the last 3 days inclusive.
>
> Price must then make a new high.
>
> Can anyone see any glaring mistakes?
>
> Gradient = MA(C,200) - Ref(MA(C,200),-50);
>
> GradientB = 5 * ATR(200);
>
> Buy = Gradient > GradientB
>
> AND BarsSince(MA(C,3) - Ref(MA(C,3),-1) < 0) <= 3
>
> AND
>
> H > Ref(HHV(H,1),-1);
>
> Buy =   Open > Ref( Low , -1 );
>
> Sell =  Close < Ref( LLV(  Low , 3 ),-1);
>
>
> cheers
> Deam

------------------------------------

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/