PureBytes Links
Trading Reference Links
|
I am migrating from Easylanguage to AFL. I wrote an exploration to identify the change in direction of High or low standard error bands. My settings are: n days: 1, since I wished to get a list of tocks that have turned on the last day.
The last date is March 4. But I am getting stocks that made the turn one day earlier on march 3. Which means the pivot low was made on March 3 - March 3 is higher than March 2, March 2 is lower than previous day, thus March 2 pivot is confirmed on March 3. The database is end of day. The code is given below. Help will be appreciated.
Periods = Param("Standard Error", 8, 3, 100, 1);
function SteBand( array, periods, upper )
{
Lr = LinearReg( array, periods );
se = StdErr( array, periods );
return LR + IIf( upper, 1, -1 ) * 2 * se;
}
upperstderrband = MA(SteBand( C, Periods, True ),3);
lowerstderrband = MA(SteBand( C, Periods, False ),3);
midstderrband = (upperstderrband + lowerstderrband )/2;
ThisIsLastBar = BarIndex() == LastValue( BarIndex() );
IsVolume = Volume * Close > 10000000;
HighMovesDown = Ref(upperstderrband,-1) > upperstderrband AND Ref(upperstderrband,-1) > Ref(upperstderrband,-2);
LowMovesUp = Ref(lowerstderrband,-1) < lowerstderrband AND Ref(lowerstderrband,-1) < Ref(lowerstderrband,-2);
Filter = ThisIsLastBar AND IsVolume AND (HighMovesDown OR LowMovesUp);
AddColumn( Close, "Close" );
------------------------------------
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
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:
amibroker-digest@xxxxxxxxxxxxxxx
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/
|