OI_Data.vbs內容就不做介紹了,請各位讀者自行參考MultiCharts 匯入外部資料(3) --- VBScript抓取三大法人期貨未平倉量 文章內容,以下僅就 MultiCharts 程式內容作修改。
input:iName("TXF-Foreign"); vars:ii(0), vStr(""); array:aData[800,2](""); DefineDLLFunc:"shell32.dll", Long, "ShellExecuteA", Long, lpstr, lpstr, lpstr, lpstr, Long; DefineDLLFunc:"kernel32", void, "Sleep", Long; once cleardebug; if currentbar = 1 then begin ShellExecuteA(0, "open", "C:\Users\Amin\Desktop\OI_Data.vbs", "1", "", 5); Sleep(3000); value1 = _ReadFile4("C:\Users\Amin\Desktop\OIData.csv", aData); end; for ii = 0 to value1 begin if d = JulianToDate(StringToDate(aData[ii, 1])) Then begin value2 = StrToNum(aData[ii, 2]); break; end; end; plot1(value2, "TXF-Foreign", iff(value2 > 0, red, green));
參考資料: