請問如何保存深度數(shù)據(jù)? [MC]
-
MC用戶求助:
一、首先,您需要下載到您所需要的深度數(shù)據(jù),或者先實時接收深度數(shù)據(jù),通過語句if dom_isconnected then
print(dom_bidprice(0));將實時接收的數(shù)據(jù)輸出到公式編譯器的輸出面板上,然后通過將面板上的數(shù)據(jù)復制再粘貼到txt文件中去。
二、以后使用的時候,通過關鍵字txt_read讀取txt文件的內(nèi)容,然后使用關鍵字midstr、strtonum轉換成深度數(shù)據(jù),并且將每一個數(shù)據(jù)保存到變量value1中去。
三、下面是如何讀取數(shù)據(jù)的一個代碼范例,理解了之后,您可以去讀取更復雜的數(shù)據(jù)。附件中CL的txt文件是需要讀取的文件,之前保存在F盤,所以代碼中使用了路徑"F:\CL.txt"
input: len(8);
var: strg(" "), tt(0), start(3);
strg=txt_read("F:\CL.txt");
tt=strtonum(midstr(strg,start,len));
start=start+len;
if dom_isconnected then
plot1(dom_bidprice(0),"dom")
else plot1(tt,"dom");文件見鏈接:
http://dl.icetech.com.cn/download/forums/CL.txt
?
-
MC回復討論一:
一、首先,您需要下載到您所需要的深度數(shù)據(jù),或者先實時接收深度數(shù)據(jù),通過語句if dom_isconnected then
print(dom_bidprice(0));將實時接收的數(shù)據(jù)輸出到公式編譯器的輸出面板上,然后通過將面板上的數(shù)據(jù)復制再粘貼到txt文件中去。
二、以后使用的時候,通過關鍵字txt_read讀取txt文件的內(nèi)容,然后使用關鍵字midstr、strtonum轉換成深度數(shù)據(jù),并且將每一個數(shù)據(jù)保存到變量value1中去。
三、下面是如何讀取數(shù)據(jù)的一個代碼范例,理解了之后,您可以去讀取更復雜的數(shù)據(jù)。附件中CL的txt文件是需要讀取的文件,之前保存在F盤,所以代碼中使用了路徑"F:\CL.txt"
input: len(8);
var: strg(" "), tt(0), start(3);
strg=txt_read("F:\CL.txt");
tt=strtonum(midstr(strg,start,len));
start=start+len;
if dom_isconnected then
plot1(dom_bidprice(0),"dom")
else plot1(tt,"dom");文件見鏈接:
http://dl.icetech.com.cn/download/forums/CL.txt
?
-
MC回復討論二:
dom_isconnected??老師這個不太明白
?
-
MC回復討論三:
dom_isconnected關鍵字返回布爾邏輯值,用于判斷DOM數(shù)據(jù)是否可用,返回true表示可以,false表示不可以用;當DOM數(shù)據(jù)可用時,關鍵字dom_askprice、dombidprice、dom_asksize、dom_bidsize、dom_askscount、dom_bidscount才能正常使用。而DOM數(shù)據(jù)只有在接收實時行情時才能使用。
?
-
MC回復討論四:
dom_isconnected關鍵字返回布爾邏輯值,用于判斷DOM數(shù)據(jù)是否可用,返回true表示可以,false表示不可以用;當DOM數(shù)據(jù)可用時,關鍵字dom_askprice、dombidprice、dom_asksize、dom_bidsize、dom_askscount、dom_bidscount才能正常使用。而DOM數(shù)據(jù)只有在接收實時行情時才能使用。
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯(lián)系技術人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內(nèi)容