使用if的交易條件實際是一樣的,但是交易結果就不一樣。 [金字塔]
- 咨詢內容:
請教:使用if的交易條件實際是一樣的,但是交易結果就不一樣。
平空:SELLSHORT(平空條件,手數,MARKET);
平多:SELL(平多條件,手數,MARKET);
開多:BUY(開多條件,手數,MARKET);
開空:BUYSHORT(開空條件,手數,MARKET);
為什么
if cmi >=300 then begin
if x=0 then begin //趨勢kaicang
趨勢開多:BUY(開多條件 ,手數,MARKET);
趨勢開空:BUYSHORT(開空條件 ,手數,MARKET);
if holding<>0 then begin
x:=1;
end
end
if x=1 then begin //趨勢pingcang
趨勢平空:SELLSHORT(平空條件,手數,MARKET);
趨勢平多:SELL(平多條件,手數,MARKET);
if holding=0 then begin
x:=0;
end
end
end
if cmi <300 then begin
if x=1 then begin
平空:SELLSHORT(平空條件,手數,MARKET);
平多:SELL(平多條件,手數,MARKET);
if holding=0 then begin
x:=0;
end
end
{if y=0 then begin
開多1:BUY(開多平空條件 and holding <=0 and cmi<300,手數,MARKET);
開空1:BUYSHORT(開空平多條件 and holding >=0 and cmi<300,手數,MARKET);
if holding<>0 then begin
y:=1;
end
end
if y=1 then begin
平空2:SELLSHORT(開多平空條件 and holding <0 or p1>0,手數,MARKET);
平多2:SELL(開空平多條件 and holding >0 or p1<0,手數,MARKET);
if holding<>0 then begin
y:=0;
end
end
end
//注意交易系統先開后平的原則
{ if x=0 then begin
開多:BUY(開多條件 ,手數,MARKET);
if holding>0 then begin
x:=1;
Y:=1;
end
end
if y = 0 then begin
開空:BUYSHORT(開空條件,手數,MARKET);
if holding<0 then begin
X:=1;
y:=1;
end
end
if x=1 then begin
趨勢平多:SELL(平多條件,手數,MARKET);
if holding <=0 then begin
x:=0;
end
END
if y=1 then begin
趨勢平空:SELLSHORT(平空條件,手數,MARKET);
if holding >=0 then begin
y:=0;
end
ENd}
為什么下面的if代碼和上面的不一樣
交易結果不一樣 - 金字塔客服:
第二段CMI的判斷是沒寫還是忘記發了?
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 1145508240 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容