COCO研究院

 找回密碼
 註冊
搜索
查看: 2682|回復: 4

問題關於時間段的寫法

[複製鏈接]
發表於 17-3-13 07:19 | 顯示全部樓層 |閱讀模式
大家好,
我是用MC的新手, 我想請教大家,
我想只在某時間段交易, 例如只在10:00 至11:00 中交易, 應該如何寫?
發表於 17-3-13 08:58 | 顯示全部樓層
if time>=1000 and time<=1100 then begin

    xxxxxxxxxxxxxxxxxxxxxx;
    xxxxxxxxxxxxxxxxxxxxxx;

end;

發表於 17-3-14 08:45 | 顯示全部樓層
1. 直接 包起來
if 1000 <= time and time <= 1100 then begin
  ...;
  ...;
end;

2. time也是條件之一
原先可能像是這樣(很多條件,例RSI,KD)
if CD_RSI and CD_KD and ... then
  ...;

// 條件多了TIME, 變成TIME, RSI, KD
CD_TIME = 1000 <= time and time <= 1100;
if CD_TIME and CD_RSI and CD_KD and ... then
  ...;
發表於 17-3-14 11:43 | 顯示全部樓層
應該要設一個11:00強制平倉.我目前是只交易到13:30平倉, 不留倉.
 樓主| 發表於 17-3-16 16:55 | 顯示全部樓層
thank you very much
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-4-30 15:26

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook