kuolung 發表於 17-4-8 22:03

請問 data plugin 的寫法

我在 data plugin 的說明中有看到這一段

---------------------------------------------------------------------
In the second case (remote sources) quotes have to be retrieved in asynchronous   way. When GetQuotesEx() function is called for the first   time, request for new data has to be send to the data source. As data from   remote   source arrive usually after a few seconds (or more) we can not   block calling application (AmiBroker). Instead control should be returned to   AmiBroker. Depending on architecture of your data source you should eithersetup   a window or another thread that will wait for the message sent back by thedatasource when data is ready. When such message is received the plugin shouldsend   WM_USER_STREAMING_UPDATE message that will nofity AmiBroker that it shouldaskfor quotes. In the response to this message AmiBroker will call GetQuotesEx()   function again. This time you should fill Quotation array with the data you   received from remote source. To avoid repeated requests for historical intraday    data, once it is retrieved, real-time plugins begin to collect streaming time/sales   data and build-up intraday bars. Each successive GetQuotesEx()   call receives bars that were build-up inside plugin from streaming upates.Thismode of operation is used by eSignal and myTrack real-time plugins.

---------------------------------------------------

請問要如何 send message to AmiBroker

gooddog609 發表於 17-4-10 10:10

因為GetQuotesEx()是寫在dll裡面
看你的資料來源是哪裡才要決定是否使用WM_USER_STREAMING_UPDATE
AmiBroker會去call GetQuotesEx(),你的資料要等遠端的伺服器傳資料,假設要等一分鐘,因為AmiBroker執行到GetQuotesEx(),主畫面就會很像當機一樣不能動,所以就要使用thread,把GetQuotesEx可以有回傳值,AmiBroker才可以繼續操作

kuolung 發表於 17-4-10 11:03

找到方法了,
在 Notify 會傳來 Amibroker 的 hwnd 值

在 SendMessgaes 中代入就可以了

::SendMessage( g_hAmiBrokerWnd, WM_USER_STREAMING_UPDATE, 0, 0 );

lwhuang 發表於 17-4-13 07:22

你在寫什麼的 plugin?

kuolung 發表於 17-4-13 07:51

本帖最後由 kuolung 於 17-4-13 09:37 編輯

amibroker 的 realtime data plugin
目前用 群益 api 下載 k 線 元大 rtd 即時分料
頁: [1]
查看完整版本: 請問 data plugin 的寫法