一、首先,您需要下載到您所需要的深度數(shù)據(jù),或者先實(shí)時(shí)接收深度數(shù)據(jù),通過語句if dom_isconnected then
print(dom_bidprice(0));將實(shí)時(shí)接收的數(shù)據(jù)輸出到公式編譯器的輸出面板上,然后通過將面板上的數(shù)據(jù)復(fù)制再粘貼到txt文件中去。
二、以后使用的時(shí)候,通過關(guān)鍵字txt_read讀取txt文件的內(nèi)容,然后使用關(guān)鍵字midstr、strtonum轉(zhuǎn)換成深度數(shù)據(jù),并且將每一個(gè)數(shù)據(jù)保存到變量value1中去。
三、下面是如何讀取數(shù)據(jù)的一個(gè)代碼范例,理解了之后,您可以去讀取更復(fù)雜的數(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
?
一、首先,您需要下載到您所需要的深度數(shù)據(jù),或者先實(shí)時(shí)接收深度數(shù)據(jù),通過語句if dom_isconnected then
print(dom_bidprice(0));將實(shí)時(shí)接收的數(shù)據(jù)輸出到公式編譯器的輸出面板上,然后通過將面板上的數(shù)據(jù)復(fù)制再粘貼到txt文件中去。
二、以后使用的時(shí)候,通過關(guān)鍵字txt_read讀取txt文件的內(nèi)容,然后使用關(guān)鍵字midstr、strtonum轉(zhuǎn)換成深度數(shù)據(jù),并且將每一個(gè)數(shù)據(jù)保存到變量value1中去。
三、下面是如何讀取數(shù)據(jù)的一個(gè)代碼范例,理解了之后,您可以去讀取更復(fù)雜的數(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
?
dom_isconnected??老師這個(gè)不太明白
?
dom_isconnected關(guān)鍵字返回布爾邏輯值,用于判斷DOM數(shù)據(jù)是否可用,返回true表示可以,false表示不可以用;當(dāng)DOM數(shù)據(jù)可用時(shí),關(guān)鍵字dom_askprice、dombidprice、dom_asksize、dom_bidsize、dom_askscount、dom_bidscount才能正常使用。而DOM數(shù)據(jù)只有在接收實(shí)時(shí)行情時(shí)才能使用。
?
dom_isconnected關(guān)鍵字返回布爾邏輯值,用于判斷DOM數(shù)據(jù)是否可用,返回true表示可以,false表示不可以用;當(dāng)DOM數(shù)據(jù)可用時(shí),關(guān)鍵字dom_askprice、dombidprice、dom_asksize、dom_bidsize、dom_askscount、dom_bidscount才能正常使用。而DOM數(shù)據(jù)只有在接收實(shí)時(shí)行情時(shí)才能使用。