相關標簽:
5分鐘通道策略旨在捕捉趨勢行情中在上升或者下降通道內的震蕩,
即捕捉市場中有意義的回撤,通過短線持有以獲得小額收益的積累。
模型策略源碼:{ 5分鐘通道策略 5分鐘通道策略旨在捕捉趨勢行情中在上升或者下降通道內的震蕩, 即捕捉市場中有意義的回撤,通過短線持有以獲得小額收益的積累。 應用周期:5分鐘 } //定義參數 Input:N(12,1,100,1);//均線和標準差參數 Num:=1;//開倉手數 //中間變量 Ma10:Ma(c,N);//10日均線 Std1:=Std(c,N);//一個標準差 Upper:=Ma10+Std1;//通道上軌 Bottom:=Ma10-Std1;//通道下軌 BuyCond:=h>ref(h,1) and l>ref(l,1) and l<=Bottom;//上漲趨勢中價格觸及下軌 SellCond:=h<ref(l,1) and l<ref(l,1) and h>=Upper;//下跌趨勢中價格初級上軌開倉 //下單語句 if BuyCond then begin Sellshort(holding<0,0,market);//市價平空 Buy(holding=0,Num,market);//市價開多 end if SellCond then begin Sell(holding>0,0,market);//市價平多 BuyShort(holding=0,Num,market);//市價開空 end //止盈止損 Win_Buy:=h-enterprice>=2;//多頭盈利2點 Win_Sell:=enterprice-l>=2;//空頭盈利2點 Lose_Buy:=enterprice-l>=1.25;//多頭虧損1.25點 Lose_Sell:=h-enterprice>=1.25;//空頭虧損1.25點 //市價止盈止損 if Win_Buy and holding>0 then 多止盈:Sell(enterbars>0,0,market); if Win_Sell and holding<0 then 空止盈:Sellshort(enterbars>0,0,market); if Lose_Buy and holding>0 then 多止損:Sell(enterbars>0,0,market); if Lose_Sell and holding<0 then 空止損:Sellshort(enterbars>0,0,market); 點擊復制上述代碼粘貼到到公式管理器
{別忘了將本網告訴您身邊的朋友,向朋友傳達有用資料,也是一種人情,你朋友會感謝你的。}