PureBytes Links
Trading Reference Links
|
Hi all,
I wrote this code but it seems like the weekly criteria is not working
very well. I want cond1 to include weekly channel sloping upward
and cond2 to slope downwards. The reason why it doesn't work is
because I did an exploration from 7/12 to 7/13 and stocks like CAT,
AMGN appeared as short (cond2) but when I check the charts using the
"look back" feature, the channel was trending upwards. Here is
the code:
TimeFrameSet (inWeekly);
LinRegChanSlope1 = LinRegSlope (Close, 23) ;
TimeFrameRestore ();
Cond1 = (Cross (LinRegVal,EMAVal) OR LinRegVal > LinRegVal1 OR
doublebottom) AND LinRegChanSlope1 > 0 AND reward1 >= 1 AND Ref
(Close, -1) < LowerChanVal ;
Cond2 = (Cross (EmaVal, LinRegVal) OR LinRegVal1 > LinRegVal OR
doubletop) AND LinRegChanSlope1 < 0 AND reward2 >= 1 AND Ref
(Close, -1) > UpperChanVal ;
Any help is appreciated,
thanks
tony
qitrader
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
|