COCO研究院

 找回密碼
 註冊
搜索
查看: 1302|回復: 1

請教 Amibroker 如何找出每個交易時刻的第一棒 ?

[複製鏈接]
發表於 14-1-17 17:20 | 顯示全部樓層 |閱讀模式
各位大大, 我是新手, 想用 amibroker 來做少少分析, 請問 amibroker 的 AFL 語言中, 如何找出每個交易時段的第一棒 Open 和 Close ?

例如:
2014-01-17 09:15:00 Open 22000 Close 22100
2014-01-17 09:16:00 Open 22100 Close 22050
....
...
2014-01-17 11:59:00 Open 22100 Close 22030

我想找出第一棒的 Close - Open 值來 做買入訊號之一 (即是 09:15這一棒: 22100 - 22000 = 100)
請問應該如何寫呢 ? 謝謝各位大大指點
發表於 14-1-20 14:19 | 顯示全部樓層
Different=Close-Open;
_Day=dayofweek();
FirstBarFlag=_Day!=ref(_Day,-1);
Condition1=IFF ( different > 100 , 1 , 0);   //example only
Condition2=FirstBarFlag;   
Condition3=… ;   //your entry condition
Buy = Condition1 and Condition2 and Condition3;
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-6-1 18:37

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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