Params
??? Numeric Length(30);
Vars
??? Numeric Lost(2);???????????//定義止損參數(shù)
??? Numeric Win(2);???????????//定義止盈參數(shù)
??? Numeric Time_Exit(145955);???????//定義尾盤(pán)清倉(cāng)時(shí)間
??? Numeric MinP;????????????//定義合約最小變動(dòng)價(jià)位
? NumericSeries Ma1;
Begin
??? MinP = MinPrice;
? Ma1 = Ma(New,Length);
PlotNumeric("MA1", Ma(New, Length));
PlotNumeric("LV1",LV(New,20));
//------------------------------------------------------開(kāi)倉(cāng)條件-------------------------------------------------------
? If(MarketPosition == 0)
??? {
???If(Every(New > Ma1,10) && New > HV(New,20) && Time < Time_Exit / 1000000)
???SellShort;
???If(Every(New < Ma1,10) && New < LV(New,20) && Time <Time_Exit / 1000000)
???Buy;
? }
?//-----------------------------------------------------平倉(cāng)條件-----------------------------------------------------------
?? If(MarketPosition == 1 )
?? {
???If(New > BKPrice + Win * MinP)
???Sell;
???Else If( New < BKPrice - Lost * MinP)
???Sell;
???Else If(Every(New <= BKPrice,40) && BarsBuy > 40)
???Sell;
?? }
?? If(MarketPosition == -1 )
?? {
???If(New < SKPrice -? Win * MinP)
???BuyToCover;
???Else If( New > SKPrice +Lost * MinP)
???BuyToCover;
???Else If(Every(New >= SKPrice,40) && BarsSellShort > 40)
???BuyToCover;
?? }
End
?
?
?來(lái)源:程序化99
?
?來(lái)源: www.kzuj.com.cn
?鎳1911,老師加載后仔細(xì)觀察就會(huì)發(fā)現(xiàn)問(wèn)題。??
文件名:庫(kù)安量化云計(jì)算軟件截圖20191003175019.jpg
?