討論區列表
元大MultiCharts
一般模式
討論串模式
標題:
[發表] 台指期加減碼空單的程式問題
by 2015-11-12 00:22:08
0
暱稱:
達老師
信箱:不顯示
成就:發文(0) / 回文(0) / 推薦(0)
你好
請問一下我想要利用RSI(close,9)下空單並做加減碼動作
一次下一口, 最多加到兩口空單
程式如下:
if currentcontracts = 0
then begin
if RSI(Close,9) <= 40
then begin
sellshort 1 contracts next bar at market;
RSI9high = 41;
RSI9low = 39;
end;
end else begin
Condition1 = false;
Condition2 = false;
if marketposition = -1
then begin
Condition1 = RSI(Close,9) <= RSI9low;
Condition2 = RSI(Close,9) >= RSI9high;
end;
if Condition1 and currentcontracts > -2
then begin
sellshort 1 contracts next bar at market;
RSI9low = RSI9low - 1;
RSI9high = 40;
end;
if Condition2
then begin
buytocover 1 contracts next bar at market;
RSI9low = RSI9low + 1;
RSI9high = RSI9high + 1;
end;
end;
但是出現個奇怪的問題
就是第一口條件成立時(RSI(close,9) <= 40)
成功下了一口空單
然後這時候
RSI9high 也正確設成41
但是在下一個tick進來時
又變成了40
所以大於40的時候我又馬上平倉
但是我預期應該是大於41才應該平倉
請問大大我的程式有甚麼問題嗎
我找了很久找不出來
感激不盡
第一頁
上一頁
下一頁
最後頁
討論區列表
元大MultiCharts
MultiCharts
│
討論區
│
會員專區
│
教學講座
│
支援與服務
│
產品購買
│
申請試用
All rights for MultiCharts Trading Software are reserved by MultiCharts, LLC
凱衛資訊股份有限公司 營利事業統一編號(21261212) 著作權所有 本網站最佳瀏覽解析度為 1024 x 768
隱私權政策
│
網站安全政策
│
著作權說明
若不清楚點選圖片更新驗證碼
註冊帳號
忘記密碼
解除鎖定