指定范圍內(nèi)數(shù)據(jù)求和 [開拓者 TB]
- 咨詢內(nèi)容:
假如說當(dāng)前共計有2000根K線,我只需要對1000到1050這個范圍內(nèi)的收盤價求和,我該怎么做,麻煩幫我看下如何編寫對應(yīng)代碼
- TB技術(shù)人員:
Params
Numeric NumBegin(10);
Numeric NumAdd(5);
Vars
NumericSeries GetNum(0);
Numeric Total(0);
Begin
GetNum=close;
If(currentbar>=NumBegin and currentbar<NumBegin+NumAdd)
PlotString("Num",text(GetNum),h);
If(barstatus==0 or currentbar>NumBegin+NumAdd)
{SetGlobalVar(1,InvalidNumeric)lotBool("c",true);}
If(currentbar==NumBegin) SetGlobalVar(1,close);
If(currentbar>=NumBegin+1 And CurrentBar<NumBegin+NumAdd)
{
Total=GetNum+GetGlobalVar(1);
SetGlobalVar(1,Total);
PlotString("total",text(getglobalvar(1)),low,-1,0);}
End
希望能滿足你的要求,格式寫的有點亂 - TB客服:
樓上大才。。。
Summation(c[1000],50);
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點擊查看價格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容