COCO研究院

 找回密碼
 註冊
搜索
查看: 4865|回復: 9

[其他程式語言] 你有冇看"程式交易:方法與實務應用"? 我想買但是有問題...

[複製鏈接]
發表於 13-9-3 12:10 | 顯示全部樓層 |閱讀模式
書內有沒有programming example, 例如Java, .NET (VB, C#)?

發表於 13-9-3 12:43 | 顯示全部樓層
有附很多VBA程式碼
 樓主| 發表於 13-9-3 14:19 | 顯示全部樓層
alexliou 發表於 13-9-3 12:43
有附很多VBA程式碼

vba 是用excel做database, 比較用vb, c#, java直接在excel或sql拿data出來不同吧!? vba又會一行一行寫result到excel...又用result那一行再計下一行result...好不同!?

發表於 13-9-3 14:47 | 顯示全部樓層
crunchor 發表於 13-9-3 14:19
vba 是用excel做database, 比較用vb, c#, java直接在excel或sql拿data出來不同吧!? vba又會一行一行寫res ...

雖然還沒有買,但作者大概提及這一本跟前一本主要的差別是多了與券商API的連結,
與一些小部分內容的增刪,詳細目錄可以到網路書局看看,
所以應該還是維持大部分都是用VBA來寫程式交易的內容。

最基本的理由是:
1.Excel幾乎每個人都有
2.VBA好讀易懂又好寫
3.VBA要跨入VB.NET陣痛少
4.Excel的儲存格不錯用



所以要自建程式交易,這本書算是首選。

但是若是程式功力高深者,或許只要稍微看看如何自建程式交易的架構,
再自行以自己熟悉的語言下去撰寫程式交易,或許是比較好的方式。

若是JAVA的愛用者,倒是可以參考http://www.coco-in.net/forum-140-1.html
PHILIPZ大,也有分享使用JAVA自建的程式交易機器人,
所有的CODE也都是公開的,可以自行取用。
發表於 13-9-3 15:38 | 顯示全部樓層

y9

本帖最後由 alexliou 於 13-9-3 15:57 編輯
crunchor 發表於 13-9-3 14:19
vba 是用excel做database, 比較用vb, c#, java直接在excel或sql拿data出來不同吧!? vba又會一行一行寫res ...

VBA (Visual Basic for Applications)基本上就是VB的語法
它可以存取許多種不同的database, 如access  or SQL等
當然它也可以把EXCEL的表格當database

在MS OFFICE 的各項軟體中
最常和VBA一起使用的就是EXCEL

該書作者使用EXCEL VBA作為使用者自建系統的開發工具

 樓主| 發表於 13-9-3 17:37 | 顯示全部樓層
alexliou 發表於 13-9-3 15:38
VBA (Visual Basic for Applications)基本上就是VB的語法
它可以存取許多種不同的database, 如access  or  ...

yes I understand, just using excel as database seem like having very different structure in the program coding. Is that instead of writing a temporary result in a new excel column, I put the result in a new array? Then I use this temporary array "column" to do more calculation like how vba does in excel?

 樓主| 發表於 13-9-4 12:26 | 顯示全部樓層
rockwell 發表於 13-9-3 14:47
雖然還沒有買,但作者大概提及這一本跟前一本主要的差別是多了與券商API的連結,
與一些小部分內容的增刪 ...

PHILIPZ is very great!

發表於 13-9-4 14:14 | 顯示全部樓層
本帖最後由 alexliou 於 13-9-4 14:16 編輯
crunchor 發表於 13-9-3 17:37
yes I understand, just using excel as database seem like having very different structure in the pr ...

Actually the author dose not use excel sheet as a database, he uses excell sheets as output interface to make users easily see the results. In most of the his examples, the input data is read from a text file into arrays. All intermediate results are stored in user-defined variables rather than cells in the excell sheets.

A stub of codes from that book is attached below for your reference.

Dim i As Single, j As Single
Dim Min_Bar(1000, 6) As Variant 'Time, O,H,L.C,V
Dim O As Single
Dim H As Single
Dim L As Single
Dim C As Single
Dim V As Single
Dim NP As Single
Sub 關閉DDE自動交易系統()
    On Error Resume Next
    Application.OnTime Now + TimeValue("00:00:02"), "ThisWorkBook.ExeSelf", , False
End Sub
Sub 啟動DDE自動交易系統()
    Dim k As Single
    j = 2
    Application.OnTime TimeValue("08:45:00"), "ExeSelf"
    'Call ExeSelf
End Sub
Private Sub ExeSelf()
    On Error Resume Next
    i = i + 1
    If i = 58 Then ' i = 60
        Sheets(2).Cells(j, 1) = Time
        Sheets(2).Cells(j, 2) = O
        Sheets(2).Cells(j, 3) = H
        Sheets(2).Cells(j, 4) = L
        Sheets(2).Cells(j, 5) = C
        Sheets(2).Cells(j, 6)
.........
 樓主| 發表於 13-9-4 15:05 | 顯示全部樓層
alexliou 發表於 13-9-4 14:14
Actually the author dose not use excel sheet as a database, he uses excell sheets as output interfa ...

very cool and thx for showing me the codes. Do you use Java to trade now? Do you think this book is helpful to learn? I am from Hong Kong and it is so sad that we can only use Interactive Broker over here to have API, all local brokerages don't have API, this is like stone age comparing to Taiwan or USA.

 樓主| 發表於 13-9-7 18:37 | 顯示全部樓層
有冇其他好書介紹?
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-4-29 19:45

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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