COCO研究院

 找回密碼
 註冊
搜索
查看: 2568|回復: 0

AB中宝塔线的写法?!

[複製鏈接]
發表於 11-8-26 11:24 | 顯示全部樓層 |閱讀模式
有没有哪位大大知道TOW指标的写法?小弟写一段,但测试通不过,请指下!!

C1=C;

O1=O;

for(i = 1; i <= barCOUNT; i ++ )

{


if(i == 1)


{



if(c1 > o1)



{



x = 1;



cc1 = c1;



oo1 = o1;



}




else if(c1 < o1)



{



x = 4;



cc4 = c1;



oo4 = o1;



}


}


else


{



cc1 = c1;



oo1 = o1;



cc4 = c1;



oo4 = o1;


}



if(i ==2)


{



if(x[i-1] ==1 || x[i-1] == 0)



{



if(c1>cc1[i-1])



{



x = 1;//



cc1= c1;



oo1= cc1[i-1];



}



else if(c1 < oo1[i-1])



{



x = 3;//
阳平下


cc1 = cc1[i-1];


oo1 = oo1[i-1];


cc4 = c1;


oo4 = oo1[i-1];



}



else



{



x = 2;//
阳平



cc1 = cc1[i-1];



oo1 = c1;



}



}



if(x[i-1] == 4 || x[i-1] == 0)



{



if(c1 < cc4[i-1])



{



x = 4;//



cc4 = c1;



oo4 = cc4[i-1];



}



else if(c1 > oo4[i-1])



{



x = 6;//
阴平上



cc4 = oo4[i-1];



oo4 = cc4[i-1];



cc1 = c1;



oo1 = oo4[i-1];



}



else



{



x = 5;//
阴平



cc4 = cc4[i-1];



oo4 = c1;



}



}


}



if(i > 2)


{



if(x[i-1] = 1)



{



if(c1 > cc1[i-1])



{



x = 1;



cc1 = c1;



oo1 = cc1[i-1];



}



else if(c1 < oo1[i-1])



{



x = 3;



cc1 = cc1[i-1];



oo1 = oo1[i-1];



cc4 = c1;



oo4 = oo1[i-1];



}



else



{



x = 2;



cc1 = cc1[i-1];



oo1 = c1;



}



}



if(x[i-1] == 2)



{



if(c1 > cc1[i-1])



{



x = 1;



cc1 = c1;



oo1 = cc1[i-1];



}



else if(c1 < oo1[i-1])



{



x = 3;



cc1 = cc1[i-1];



oo1 = oo1[i-1];



cc4 = c1;



oo4 = oo1[i-1];



}



else



{



x = 2;



cc1 = cc1[i-1];



oo1 = c1;



}



}



if(x[i-1] == 3)



{



if(c1 > oo1[i-1])



{



x = 6;



cc4 = oo4[i-1];



oo4 = cc4[i-1];



cc1 = c1;



oo1 = oo4[i-1];



}



else if(c1 < cc4[i-1])



{



x = 4;



cc4 = c1;



oo4 = cc4[i-1];



}



else



{



x = 5;



cc4 = cc4[i-1];



oo4 = c1;



}



}





if(x[i-1] == 4)



{



if(c1 < cc4[i-1])



{



x = 4;



cc4 = c1;



oo4 = cc4[i-1];



}



else if(c1 > oo4[i-1])



{



x = 6;



cc4 = oo4[i-1];



oo4 = cc4[i-1];



cc1 = c1;



oo1 = oo4[i-1];



}



else



{



x = 5;



cc4 = cc4[i-1];



oo4 = c1;



}



}





if(x[i-1] == 5)



{



if(c1 > oo4[i-1])



{



x = 6;



cc4 = oo4[i-1];



oo4 = cc4[i-1];



cc1 = c1;



oo1 = oo4[i-1];



}



else if(c1 < cc4[i-1])



{



x = 4;



cc4 = c1;



oo4 = cc4[i-1];



}



else




{



x = 5;



cc4 = cc4[i-1];



oo4 = c1;



}



}





if(x[i-1] == 6)



{



if(c1 < oo1[i-1])



{



x = 3;



cc1 = cc1[i-1];



oo1 = oo1[i-1];



cc4 = c1;



oo4 = oo1[i-1];



}



else if(c1 > cc1[i-1])



{



x = 1;



cc1 = c1;



oo1 = cc1[i-1];



}



else



{



x = 2;



cc1 = cc1[i-1];



oo1 = c1;



}



}


}

}

您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-11-22 23:47

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 |