联系方式 Contact

云指标公式网

淘宝:zb-mart.taobao.com

电话:18020657357

微信:18020657357

Q Q:396950280

点击这里给我发消息

网址:www.yzhibiao.com

搜索 Search
你的位置:首页 > 公式动态 > 飞狐公式

刀小玩k线系列 一句话:以均价为基准的K线

2015-10-16 14:19:31点击:

{一句话:以均价为基准的K线}

FO:=OPEN;
FH:=HIGH;
FL:=LOW;
FC:=CLOSE;
FC[1]:=(2*FC[1]+FH[1]+FL[1])/4;
FOR I=2 TO DATACOUNT DO BEGIN 
FO[I]:=(FO[I-1]+FC[I-1])/2;
FH[I]:=IF(FO[I]>FH[I],FO[I],FH[I]);
FL[I]:=IF(FO[I]<FL[I],FO[I],FL[I]);
FC[I]:=(2*FC[I]+FH[I]+FL[I])/4;
END;
KK:=IF(FC>=FO AND (FC>=REF(FC,1) OR REF(FC,1)>=REF(FO,1)),1,IF(FC<FO AND (FC<REF(FO,1) OR REF(FC,1)<REF(FO,1)),-1,0));
明日转折:ROUND((FO + FC) / 2*10)/10,SHIFT1,LINETHICK0,COLORFFFF;
今日转折:=IF(KK=1,MIN(FC,FO),IF(KK=-1,MAX(FC,FO),IF(REF(KK,1)=1,MIN(FC,FO),IF(REF(KK,1)=-1,MAX(FC,FO),(FC+FO)/2))));
DRAWNUMBER(ISLASTBAR,明日转折,ROUND(今日转折*100)/100,2),SHIFT3;
STICKLINE(FC>FO,FH,FL,0.4,0),COLORFF;
STICKLINE(FO>FC,FH,FL,0.4,0),COLORFFFF00;
STICKLINE(KK=1 AND FC>=FO,FO,FC,8,0),COLORFF;
STICKLINE(KK=1 AND FC<FO,FO,FC,8,0),COLORFF;
STICKLINE(KK=-1 AND FC>=FO,FO,FC,8,0),COLORFF0000;
STICKLINE(KK=-1 AND FC<FO,FO,FC,8,0),COLORFF0000;
STICKLINE(KK=0 AND FC>=FO,FO,FC,8,0),COLORFF;
STICKLINE(KK=0 AND FC<FO,FO,FC,8,0),COLORFF;