cellan 發表於 11-5-30 12:32

本帖最後由 cellan 於 11-5-30 12:36 PM 編輯

回復 15# oneman001

//+------------------------------------------------------------------+
//| bbb.mq4 |
//| Copyright ?2011, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2011, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
int handle;
datetime orderOpen=OrderOpenTime();
handle=FileOpen("filename.csv", FILE_CSV|FILE_WRITE, ';');
if(handle>0)
{
FileWrite(handle, Open);
FileClose(handle);
}

//----
return(0);
}
//+------------------------------------------------------------------+
我新發現
將這程式碼創建到
智能交易系統裡
就能達到我要的輸出效果
但他卻輸出到
C:\Documents and Settings\TEST\AppData\Local\VirtualStore\Program Files\FxPro - MetaTrader\experts\files
光我要抓這路另就得寫這麼長一段

mt4真的濫到沒辦法改變輸出的路徑
讓他輸出到
R:\   

oneman001 發表於 11-5-30 12:38

其實小的對這個可程式的軟體 還不懂
不過找機會學學到是很好
謝謝版大
祝福

無無明 發表於 11-5-30 12:58

FileWrite(handle, TimeToStr(Time, TIME_DATE),Open );

抱歉,忘了 指定 i

enochyu 發表於 12-10-26 16:28

cellan 發表於 11-5-30 12:32 static/image/common/back.gif
回復 15# oneman001




小弟剛好遇到相同困擾,爬文的時候剛好看到此文,也在 MQL4 文章中提到一個解決方案,有需要的大大可以參考看看 XD

------
If you still need to work outside the directories (defined for safety reasons), you can call the functions of Windows OS. For this purpose, the functions of API represented in kernel32.dll library are widely used.

參考資料 http://articles.mql4.com/720

頁: 1 [2]
查看完整版本: MT4輸出開高低收到文件(原碼範例)