【美股最權威投資國外期貨/程式交易/最佳外匯交易平台指南】【GoForTrading/GO交易】's Archiver

gogogo 發表於 2014-10-28 18:36

[工具] 分享一個 MC 讀取外部資料的外掛 DLL

[size=3]最近因為有些原因 , 需要讀取外部的資料檔 ,  但又不想動用到 dataN , 所以本來是想用MC_IO.dll
拿來用  , 但是好像遇到一些問題 , 所以索性乾脆自己發展一組 , 只能適用於 MC 專業版 , 不適用於
MC 券商版 , x64 的部分個人有在用 , x86 的部分因為自己沒灌 , 所以就只提供不測試了 , 附上原始碼 .
是用免費的 Dev C++ 5.8.0 版編譯的 , 有做一些防護 , 以免像 MC_IO.dll 檔案不存在 MC 會有 crash
的風險
[/size]
附上 Dev C++ 5.8.0 版的鏈結 , 這是一個免費的 C++ IDE 編譯器 , [url]http://orwelldevcpp.blogspot.tw/[/url]

[attach]332[/attach][attach]333[/attach]


提供一個使用範例 :

vars: value2(0);     // file position pointer
vars: idx   (0);
vars: DigitStr("");


if LastBarOnChart and BarStatus(1)=2 then
  begin
        
     FileDelete( "e:\hello.txt" );
     
     value2 = 0;
     
     for idx=0 to 2000
       begin
      
           value2 = _FIO_ReadDigit( "filename.txt" , value2 , DigitStr );
           
           _FIO_Write( "e:\hello.txt", text(doublequote,DigitStr,doublequote,Spaces(30-Strlen(DigitStr)),  value2:8:0 ) , 1 );
           
       end;
     
  end;

[url=http://www.coco-in.net/thread-37303-1-1.html]轉貼[/url]~

頁: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.