PureBytes Links
Trading Reference Links
|
/* 5 Point Spline Interpolation v2
*/
wavetable = 2048;
nMask = wavetable-1<FONT
size=1>;
G1 = DEMA<FONT
size=1>(C,17);
G2= DEMA<FONT
size=1>(Avg,4);
Var = G2;
Array = Var ;
ArrayLocation = Var ;
nearest_sample = int<FONT
size=1>(Array);
location = int<FONT
size=1>(ArrayLocation);
X = location - nearest_sample;
p0=wavetable*((nearest_sample-2<FONT
size=1>)*nMask);
p1=wavetable*((nearest_sample-1<FONT
size=1>)*nMask);
p2=wavetable*(nearest_sample);
p3=wavetable*((nearest_sample+1<FONT
size=1>)*nMask);
p4=wavetable*((nearest_sample+2<FONT
size=1>)*nMask);
p5=wavetable*((nearest_sample+3<FONT
size=1>)*nMask);
interpolate = p2 + <FONT color=#ff00ff
size=1>0.04166666666*x*((p3-p1)*<FONT color=#ff00ff
size=1>16.0+(p0-p4)*<FONT color=#ff00ff
size=1>2.0
+ x *((p3+p1)*16.0<FONT
size=1>-p0-p2*30.0- p4
+ x *(p3*66.0<FONT
size=1>-p2*70.0<FONT
size=1>-p4*33.0<FONT
size=1>+p1*39.0+
p5*7.0- p0*<FONT
color=#ff00ff size=1>9.0
+ x *( p2*126.0<FONT
size=1>-p3*124.0<FONT
size=1>+p4*61.0<FONT
size=1>-p1*64.0-
p5*12.0+p0*<FONT
color=#ff00ff size=1>13.0
+ x *((p3-p2)*50.0<FONT
size=1>+(p1-p4)*25.0<FONT
size=1>+(p5-p0)*5.0<FONT
size=1>)))));
BH = DEMA<FONT
size=1>(interpolate,3<FONT
size=1>);
Plot (interpolate,"5
spline interpolate",<FONT color=#ff00ff
size=1>7,4<FONT
size=1>);
Plot (BH ,<FONT color=#ff00ff
size=1>"DEMA4interpolate",<FONT color=#ff00ff
size=1>5,4<FONT
size=1>);
//Plot (EMA(interpolate,3),"EMA2interpolate",4,4);
BHS = Cross<FONT
size=1>(BH,interpolate);
Plot(BHS*interpolate,<FONT color=#ff00ff
size=1>"BHS",4<FONT
size=1>,6);<FONT
color=#008000 size=1>//Vertical Red
BLB = Cross<FONT
size=1>(interpolate,BH);
Plot(BLB*interpolate,<FONT color=#ff00ff
size=1>"BLB",5<FONT
size=1>,6); <FONT
color=#008000 size=1>//Vertical Green
GraphXSpace =4<FONT
size=1>;
Mr
Valley
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Sponsor
ADVERTISEMENT
Click Here
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 the Yahoo! Terms of Service.
Attachment:
5 Point Spline Interpolation v2.afl
Attachment:
Description: "Description: Binary data"
|