幫忙檢查下程序 [金字塔]
- 咨詢內容:
DayVarValue1:ma(close,5);//
DayVarValue2:ma(close,10);
//開倉條件
DayIntervalValue:=DayVarValue1-DayVarValue2;
KD:=ref(low,1)<DayVarValue2 and ref(close,1)>=DayVarValue2 and date>=1120101 and time<=143000 ; //開多條件
//PD:=ref(close,1)>=(DayVarValue2+0.5*DayIntervalValue); //平多條件
PD:=(ref(close,1)>=(DayVarValue2+ratio*DayIntervalValue)) or (ref(close,1)<DayVarValue2 and ref(close,2)<DayVarValue2);
KK:=ref(high,1)>DayVarValue1 and ref(close,1)<DayVarValue1 and date>=1120101 and time<=143000; //開空條件
PK:=(ref(close,1)<=(DayVarValue1-0.5*DayIntervalValue)) or (ref(close,1)>DayVarValue1 and ref(close,2)>DayVarValue1); //平空條件
//PD:=(ref(close,1)>=(DayVarValue2+ratio*DayIntervalValue)) or (ref(close,1)<DayVarValue2 and ref(close,2)<DayVarValue2);BUY(KD AND HOLDING=0,1,OPEN); //開多信號
SELL(HOLDING>0 AND PD,1,OPEN); //平多信號
BUYSHORT(KK AND HOLDING=0,1,OPEN); //開空信號
SELLSHORT(holding<0 AND PK,1,OPEN); //平空信號if time>=150000 then begin
sell(holding>0,1,market);
sellshort(holding<0,1,market);
end----------------------------------------------------
測試正常,為什么沒信號出來?股指連續5min周期上
- 金字塔客服:
公式中下單函數的價位參數寫錯了
要么是buy(cond,vol,limitr,open);
要么是buy(cond,vol,market);
寫成buy(cond,vol,open);是不對的
- 用戶回復: 是的噢。。謝謝啦
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容