這個條件如何編寫 [金字塔]
- 咨詢內容:
條件成立開倉,然后不成立平倉,條件又成立再開倉,然后不成立又平倉,然后今天就不再做了,就是一天最多只做兩個開倉平倉,但是無論什么,在三點前全部平倉,這個策略如何編寫
- 金字塔客服:
variable:n=0;
if 開倉條件 and holding=0 and n<2 then buy.........;
if 平倉條件 and holding>0 then begin
sell......
n:=n+1;
end
if time>=145500 then sell.........;
- 用戶回復:
variable:n=0;
if TIME>091500 AND TIME<151300 AND 開多條件 and holding=0 and n<2 then BUY(1,1,MARKET);
if TIME>091500 AND TIME<151300 AND 平多條件 and holding>0 then begin
SELL(1,1,MARKET);
n:=n+1;
endif TIME>091500 AND TIME<151300 AND 開空條件 and holding=0 and n<2 then BUYSHORT(1,1,MARKET);
if TIME>091500 AND TIME<151300 AND 平空條件 and holding<0 then begin
SELLSHORT(1,1,MARKET);
n:=n+1;
end
IF TIME>151300 THEN
BEGIN
全平空:SELLSHORT(HOLDING<0,0,MARKET);
全平多:SELL(HOLDING>0,0,MARKET);
END這段代碼為什么不出現信號
- 網友回復:
variable:n=0;
if date<>ref(date,1) then n:=0;
if TIME>091500 AND TIME<151300 AND 開多條件 and holding=0 and n<2 then BUY(1,1,MARKET);
if TIME>091500 AND TIME<151300 AND 平多條件 and holding>0 then begin
SELL(1,1,MARKET);
n:=n+1;
endif TIME>091500 AND TIME<151300 AND 開空條件 and holding=0 and n<2 then BUYSHORT(1,1,MARKET);
if TIME>091500 AND TIME<151300 AND 平空條件 and holding<0 then begin
SELLSHORT(1,1,MARKET);
n:=n+1;
end
IF TIME>151300 THEN
BEGIN
全平空:SELLSHORT(HOLDING<0,0,MARKET);
全平多:SELL(HOLDING>0,0,MARKET);
END加了一個全局變量重置,看看效果咋樣
- 網友回復:
就今天上午的行情,為什么在2314.8 和2314.2兩上價位了上開了空單?
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容