![]() |
在這個頁面顯示本主題全部的 7 個文章 |
奇狐社區論壇 (http://www.chiefox.com.tw/bbs/index.php)
- 問題交流 (http://www.chiefox.com.tw/bbs/forumdisplay.php?forumid=28)
-- 請問輸出字串到外部文字檔 (http://www.chiefox.com.tw/bbs/showthread.php?threadid=13197)
請問輸出字串到外部文字檔
請教各位大大,希望在指標發出買賣信號時,輸出字串到外部文字檔,但卻不斷出現VBS的執行錯誤,此時除了奇狐,並無開啟其他應用程式,請教這是什麼原因造成?又應如何修改?
謝謝!
範例:
curve : ma(C,3);
buy := cross( C, ma(C,3) );
sell := cross( ma(C,3), C );
DRAWICON( buy, ma(C,3), 4 );
DRAWICON( sell,ma(C,3), 5 );
Position := 0;
Position := if( buy, 1, Position );
Position := if( sell,-1, Position );
cur_cmd := numtostr( year,0 ) + '/' + numtostr( month,0 ) + '/' + numtostr( day,0 ) + '' + numtostr( hour,0 ) + ':' + numtostr(minute,0) + ':0' + numtostr( Position,0 ) + ' ';
<%
Dim fso, MyFile
vbs_cmd = FFL.VarData( "cur_cmd" )
Set fso = CreateObject( "Scripting.FileSystemObject" )
Set MyFile = fso.CreatTextFile( "C:\WAV\order.txt", False )
MyFile.WriteLine( vbs_cmd )
MyFile.Close
%>
下單機文檔輸出(執行vbs出錯)的處理方式
感謝阿酷兄提供寶貴經驗~
http://dt.idv.tw/viewthread.php?tid=299&extra=page%3D1
__________________
人外有人 天外有天 不懼不貪 亦富亦安
感謝大大的熱心說明,不過小弟碰到的狀況是,不知為何,一定會跳出VBS執行錯誤訊息,而不是偶爾或隨機出現,也就是說,每多跑一根新K棒出來,VBS執行錯誤訊息就一定會冒出來。
若是添加下列敘述,雖然就不會出錯,但是也不會開啟外部文字檔,也不會有任何買賣訊號寫到外部文字檔。
不知是否有哪位大大有此方面的解決經驗?感恩∼
<%
on error resume next
err.clear
%>
這樣看行不行 ~
<%
on error resume next
Dim fso, MyFile
vbs_cmd = FFL.VarData( "cur_cmd" )
Set fso = CreateObject( "Scripting.FileSystemObject" )
Set MyFile = fso.CreatTextFile( "C:\WAV\order.txt",True )
MyFile.WriteLine( vbs_cmd )
MyFile.Close
err.clear
%>
__________________
人外有人 天外有天 不懼不貪 亦富亦安
<%
on error resume next
Dim fso, MyFile
vbs_cmd = FFL.VarData( "cur_cmd" )
Set fso = CreateObject( "Scripting.FileSystemObject" )
Set MyFile = fso.CreatTextFile( "C:\WAV\order.txt",True )
MyFile.WriteLine( vbs_cmd )
MyFile.Close
err.clear
%>
請手動在C槽內「建立」WAV這個資料夾,試試。
祝均安。
__________________
永遠學習、學習永遠
善為傳家寶
忍為積德門
// C:\WAV\order.txt
// 好熟悉的路徑
curve : ma(C,3);
buy := cross( C, ma(C,3) );
sell := cross( ma(C,3), C );
DRAWICON( buy, ma(C,3), 4 );
DRAWICON( sell,ma(C,3), 5 );
Position := 0;
Position := if( buy, 1, Position );
Position := if( sell,-1, Position );
Order:= numtostr( year,0 ) + '/' + numtostr( month,0 ) + '/' + numtostr( day,0 ) + '' + numtostr( hour,0 ) + ':' + numtostr(minute,0) + ':0' + numtostr( Position,0 ) + ' ';
<%
On Error Resume Next
Dim fso, MyFile
Order = FFL.VarData("Order")
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("C:\WAV\order.txt", True)
MyFile.WriteLine (Order)
MyFile.Close
Err.Clear
%>
__________________
就是發蓊梨(ㄛㄥˇ ㄌㄞˊ) 程式交易網站
[教學]指標公式及程式交易系統撰寫 [代工]
學會指標策略程式化的撰寫,將可讓你不再盲目投下辛苦賺來的血汗錢
要知道交易的策略或交易的模式長期執行下確實可獲利
交易才有意義的.否則寧可不交易
感謝大大們的熱心說明,應該OK
全部時間均為台灣時間, 現在時間為07:18 | 在這個頁面顯示本主題全部的 7 個文章 |
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved.