請教各位大大, 我自己寫了一個簡易的小進出策略~
回測時很正常,但是今天用模擬帳號打單~
卻發生可以正常的買股票,但是到了停利點 他不會賣股票?請問我是否哪裡設定錯誤呢?
我是設定1.5%停利跟停損~
麻煩各位了
if isSignal and (Close > refHigh) and (not inTrade) then
begin
Buy(1);
takeProfit = refPrice * 1.015;
stopLoss = refPrice * 0.985;
isSignal = false; // 避免重複進場
end;
// 出場條件:停利或停損
if inTrade and (Close >= takeProfit or Close <= stopLoss) then
begin
Sell(1);
isSignal = false;
inTrade = false;
end;
2 評論