以下我設計了一個簡單的程式,策略邏輯如下
高於昨收50點做多單,買進後獲利1%加碼一口多單
低於昨收50點做空單,賣出後獲利1%加碼一口空單
尾盤13:25出場
簡單的設計只是為了要提供給日盛客服參考,請勿拿去實際下單
vars:closed1(0),longprice(0),shortprice(0)
array:cod1[84](-1)
closed1=closeofd(1,cod1)
if currentcontracts=0 and time>090000 and time<=130000 then
buy("Buy") next bar at closed1+50 stop
end if
if currentcontracts=0 and time>090000 and time<=130000 then
sell("Sell") next bar at closed1-50 stop
end if
longprice=entryprice(0)*1.01
shortprice=entryprice(0)*0.99
if currentcontracts>0 and time>090000 and time<=130000 and entryname(0)="Buy" then
buy("PlusBuy") 1 Contracts next bar at longprice stop
end if
if currentcontracts<0 and time>090000 and time<=130000 and entryname(0)="Sell" then
sell("PlusSell") 1 Contracts next bar at shortprice stop
end if
if time>=132500 then
exitlong("買平倉") next bar at market
exitshort("賣平倉") next bar at market
end if
若是選擇"對不同Signal名開放",則會出現有時加碼、有時不加碼的狀況
這是2010/1/22正常的狀態
則2010/1/26會變成正常的狀態,但怕會有不斷進出的效果
請問有誰遇過相同的問題可以跟我一起討論嗎?