期货入门基础知识,818期货学习网

通知公告

第四节 震荡指标/PIVOT系统/整数框架(5)

2014-10-04 17:14 来源:818期货学习网



手工计算轴心点数据是非常麻烦的,有些网站提供了相应的计算数据,比如Mataf.net,同时我们也在下面提供了一个在MT4.0上使用比较广泛的轴心点源代码:

#property indicator_chart_window

//#property indicator_separate_window

#property indicator_buffers 7

#property indicator_color1 Orange

#property indicator_color2 DarkBlue

#property indicator_color3 Maroon

#property indicator_color4 DarkBlue

#property indicator_color5 Maroon

#property indicator_color6 Green

#property indicator_color7 Green

//----input parameters

//----buffers

double PBuffer[];

double S1Buffer[];

double R1Buffer[];

double S2Buffer[];

double R2Buffer[];

double S3Buffer[];

double R3Buffer[];

string Pivot="Pivot Point",Supl="S1",Res1="R1";

string Sup2= "S2", Res2="R2",Sup3="S3",Res3="R3";

int fontsize=10;

double P,SI,Rl,S2,R2,S3,R3;

double LastHigh,LastLow,x;

//+ +

//| Custor indicator deinitialization function |

 



SetlndexBuffer (5,S3Buffer);

SetlndexBuffer (6,R3Buffer);

//--- name for DataWindow and indicator subwindow label

short_name="Pivot Point";

IndicatorShortName(short_name);

SetlndexLabel(0,short_name);

//----

SetlndexDrawBegin(0,1);

//----

//----

return (0);

//+ +

//| Custom indicator iteration function |

//+ +

int start ()

{

int counted_bars=IndicatorCounted();

int limit,i;

//----indicator calculation

if(counted_bars==0)

{

x=Period();

if(x>240)return (-1);



if (counted_bars<0)return(-1);

//---- last counted bar will be recounted

//if (counted_bars>0)counted_bars--;

limit=(Bars-counted_bars)-1;

for(i=limit;i>=0;i—-)

{

if(High[i+l]>LastHigh) LastHigh=High[i+l];

if(Low[i+l]<LastLow) LastLow=Low[i+l];

if(TimeDay(Time[i])!=TimeDay(Time[i+l]))

 {

 P=(LastHigh+LastLow+Close[i+l])/3;

 Rl=(2*P)+LastLow;

 S1=(2*P)-LastHigh;

 R2=P+(LastHigh-LastLow);

 S2=P-(LastHigh-LastLow);

 R3=(2*P)+(LastHigh-(2*LastLow));

 S3=(2*P)-((2*LastHigh)-LastLow);

 LastLow=Open[i];

LastHigh=Open[i];



S1Buffer[i]=S1;

R1Buffer[i]=R1;

S2Buffer[i]=S2;

R2Buffer[i]=R2;

S3Buffer[i]=S3;

R3Buffer[i]=R3;

}

//----

retum (0);

}

//+ +

声明:
如本站内容不慎侵犯了您的权益,请联系邮箱:1317369179@qq.com 我们将迅速删除。
本文来自网络,不代表【818期货学习网】立场,转载请注明出处:http://www.818qihuo.com/waihui/shunshierwei/5708.html
期货手续费【与交易所同步更新】
期货保证金【与交易所同步更新】
上一篇:第三节 英镑择时交易法的基础 下一篇:第五节 尽量选择“主要位置”——边缘介入

联系我们|投稿中心|广告合作|网站地图|免责声明

浙公网安备 33011002014220号