請教老師如何固定變量 [開拓者 TB]
-
咨詢內容:
本帖最后由 YINZHIHUI 于 2018-9-8 18:33 編輯
老師,您好!
我希望把布林30分鐘線的上軌,下軌,中軌,在上一交易日14:30的數值保存下來,在本交易日(21:00-14:00)作為開平倉的條件使用。
我使用的語句如下:
Params
Numeric Hands(1);
Numeric MALength(34);
Numeric BOLLLength1(26);
Numeric BOLLLength2(26);? ? ? ? ? ? ? ? ? ? ? ?
Numeric Offset(2);
Vars
Numeric MA;? ?? ?? ?? ???//均線
Numeric UpLine;? ? ? ? ? ? ? ?? ???//指標上軌
Numeric DownLine;? ? ? ? ? ? ? ? //指標下軌
NumericSeries MidLine;? ? ? ? //指標中軌
Numeric Band;
Numeric SG;? ? ? ? ? ? ? ???//上軌值
Numeric XG;? ? ? ? ? ? ? ? //下軌值
Numeric ZG;? ???//中軌值
Begin
MidLine = AverageFC(Close,BOLLLength1);
Band = StandardDev(Close,BOLLLength2,2);
UpLine = MidLine + Offset * Band;
DownLine = MidLine - Offset * Band;
PlotNumeric("UpLine",UpLine);
PlotNumeric("DownLine",DownLine);
PlotNumeric("MidLine",MidLine);
MA=AverageFC(Close,MALength);
PlotNumeric("MA",AverageFC(Close,MALength));
//------------------以上是指標公式------------------
if(time==0.1430)
{SG=PlotNumeric("SG",UpLine);
XG=PlotNumeric("XG",DownLine);
ZG=PlotNumeric("ZG",MidLine);
}1.jpg (176.43 KB, 下載次數: 0) 2018-9-8 18:29:12 上傳 ?
?來源:CXH99.COM
-
TB技術人員:
將SG,XG,ZG這三個變量聲明為numericseries就可以了。
試試吧。?
- TB客服: 謝謝老師!
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 511411198 或微信:cxhjy888 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容