指定范圍內(nèi)數(shù)據(jù)求和 [開(kāi)拓者 TB]
- 咨詢內(nèi)容:
假如說(shuō)當(dāng)前共計(jì)有2000根K線,我只需要對(duì)1000到1050這個(gè)范圍內(nèi)的收盤價(jià)求和,我該怎么做,麻煩幫我看下如何編寫對(duì)應(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
希望能滿足你的要求,格式寫的有點(diǎn)亂 - TB客服:
樓上大才。。。
Summation(c[1000],50);
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容