求教模型過濾問題 [金字塔]
- 咨詢內容:
我用BOLL指標建立交易系統,想過濾信號,避免反復開平倉的問題,比如開倉后3根K線不再做交易(不平不開),3根K線后再起作用。
用exitbars信號就消失。求教改如何修改我的代碼:
MID : MA(CLOSE,M);
UPPER: MID + N*STD(CLOSE,M);
LOWER: MID - N*STD(CLOSE,M);//BOLL公式
cond1:=cross(c,lower) or cross(c,mid) or cross(c,upper);
//開多條件
cond2:=cross(lower,c) or cross(mid,c) or cross(upper,c);
//開空條件if cond1 then
begin
sellshort(holding<0,0,mkt);//平空
buy(holding=0 ,2,mkt);//開多
endif cond2 then
begin
sell(holding>0,0,mkt);//平多
buyshort(holding=0,2,mkt);//開空
end - 金字塔客服:
MID := MA(CLOSE,M);
UPPER:= MID + N*STD(CLOSE,M);
LOWER:= MID - N*STD(CLOSE,M);//BOLL公式
cond1:=cross(c,lower) or cross(c,mid) or cross(c,upper);
//開多條件
cond2:=cross(lower,c) or cross(mid,c) or cross(upper,c);
//開空條件if cond1 and enterbars>=3 then sellshort(holding<0,0,mkt);//平空
if cond1 then buy(holding=0 ,2,mkt);//開多
if cond2 and enterbars>=3 then sell(holding>0,0,mkt);//平多
if cond2 then buyshort(holding=0,2,mkt);//開空
- 用戶回復:
試了下 加了過濾信號 enterbars就一點信號都米了 求解
- 網友回復:
有信號 樓主仔細檢查一下你的代碼
- 網友回復:
嗯 有了
我想問下 為什么我寫成if cond1 and enterbars>=3 then
begin
sellshort(holding<0,0,mkt);//平空
buy(holding=0 ,2,mkt);//開多
endif cond2 and enterbars>=3 then
begin
sell(holding>0,0,mkt);//平多
buyshort(holding=0,2,mkt);//開空
end
就沒有信號呢 還請前輩分析下。我想了很久邏輯上覺得沒問題啊~
如果以上指標公式不適用于您常用的行情軟件
或者您想改編成選股公式,以便快速選出某種形態個股的話,
- 上一篇:金字塔升級后下單失敗
- 下一篇:沒有了!
相關文章
-
沒有相關內容