COCO研究院

 找回密碼
 註冊
搜索
查看: 7428|回復: 5

AB可以用excel當資料源嗎?

[複製鏈接]
發表於 10-5-30 13:08 | 顯示全部樓層 |閱讀模式
TS可以用excel當資料源來設定metaserver(TS程式交易全攻略P44~P52),
請問單用excel的方式可以設定AB嗎?
 樓主| 發表於 10-5-30 22:33 | 顯示全部樓層
本帖最後由 good88 於 10-5-30 10:35 PM 編輯

應該解決了,出現CONN,
新增一組database,把設定的dde存入excel,給個檔名例"master.xls",放入amibroker,
server 設excel,
DDE設成master.xls!R2C2,
"R2C2"請參考TS程式交易全攻略P44~P52,
這是可以利用EXCEL的方式,把許多券商的DDE源用EXCEL收集,防止某一DDE源斷線,造成K棒不完整....
很籠統的分享,自己體驗吧!
 樓主| 發表於 10-5-30 22:42 | 顯示全部樓層
There are 2 ways to collect data into AB from Excel. You either
define a single cell eg. "R2C2" for cell B2 to collect data from, or
use the method mentioned in a previous post a few days ago where you
use a text symbol and define the name of each cell in Excel.

Firstly , to use the "text" symbol method for an Excel Workbook named
"Master.xls" using a sheet name of "Data"...

In "Database Settings" > "Configure" each field to be collected from
"Data" would have the entry "[MASTER.xls]Data{ticker}_"field"

So.."DDE server" enter "EXCEL"
"Open" enter "[MASTER.xls]Data{ticker}_Open"
"Last" enter "[MASTER.xls]Data{ticker}_Last"
"Volume" enter "[MASTER.xls]Data{ticker}_Volume" etc. for the various
data cells you have in the "Data" sheet. Follow AB's naming protocol
exactly. No using "Vol" for "Volume".

Due to a limitation in the "Naming" of cells in Excel the fields
"Last Size, Ask Size and Bid Size" will not work as Excel will not
accept a name with a space.

The secret to get this to actually work is to enter in the "Req*"
field..."[MASTER.xls]Data{ticker}". If you don't have this it won't
link. This field entry will establish the link in any vacant cell
apart from "Time" and you can actually combine the Single cell
reference such as "R2C2" with text Symbol entries.

Eg. the "R2C2" symbol will come up as a bid if "[MASTER.xls]
Data{ticker}" is entered for the Bid Field definition, regardless of
the other "_field" definitions entered as above at the same time for
"Configure DDE plugin". That is, the two protocols can be combined.

If you are only using AB to act as a database for any sort of live
data in Excel...this could apply to scientific data mapping for
instance, as well as trading data or custom calculations in Excel...
then a cell entry only requires the field to have the entry "[MASTER.
xls]Data{ticker}."

This can be placed in "Last", "Open", "Low" or whatever apart from
the "Time or "Req*" fields.

As mentioned in the previous post, if you are using the "text" symbol
method each cell in Excel must have it's "Name" defined. The actual
position of the cell in the sheet in not significant as such, but in
the interest of good housekeeping an orderly arrangement of columns
is preferable, obviously.

So, repeating the earlier post to name the cell...
Click on the cell>Insert>Name>Define>Add

The cell for "High" for symbol "ABC" would be defined as "ABC_High",
for "Last" "ABC_Last". When the cell is clicked on this name will
come up in the name box in Excel, rather than the cell no. if you have
done it properly. Spaces in the name are not accepted.

I hope this info is useful. More than a few hours of trial and error
have got me this far with DDE. AB can actually be a very powerful DDE
database.
發表於 10-5-31 15:50 | 顯示全部樓層
回復  good88

卷商軟體有提供DDE的話
不需要經過EXCEL
BG 發表於 10-5-30 08:43 PM



BG大.請教一下
AmiBroker 是不是能將想法轉成程式碼?
若是,哪些期貨商的下單軟體可以支援 AB 轉出的程式碼成為自動下單機?

拍誰~ 又打擾你...
 樓主| 發表於 10-5-31 16:49 | 顯示全部樓層
BG大.請教一下
AmiBroker 是不是能將想法轉成程式碼?
若是,哪些期貨商的下單軟體可以支援 AB 轉出的程 ...
tentium989 發表於 10-5-31 03:50 PM



    不好意思,我還在搞基礎建設,和抓一些現成的程式來跑...
    站內有一些這方面的高手和資料,請他們幫你解決吧!
發表於 11-8-24 16:49 | 顯示全部樓層
那篇英文的回覆我看不懂,現在我的excel已經建好了許多商品的報價,要如何讓AB認識並連結這些商品的報價呢?
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-12-22 19:01

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 |