//老師幫我看下這個后臺止贏代碼是否有問題.我的目的是當(dāng)黃金浮動盈利達(dá)到3點(diǎn)時,后臺開始從浮贏3點(diǎn)開始記錄價位,如果某價格低于1點(diǎn)后平倉.
if STKLABEL = 'AU00' then 止贏:=3;//ru
//開倉部分
GLOBALVARIABLE:標(biāo)記=0;
GLOBALVARIABLE:高差價=0;
GLOBALVARIABLE:低差價=0;
多頭差:tholding>0 and 標(biāo)記=0 and HIGH-TAVGENTERPRICE>止贏,LINETHICK0;
空頭差:tholding<0 and 標(biāo)記=0 and TAVGENTERPRICE-LOW>止贏,LINETHICK0;
if 多頭差 then begin
高差價:=HIGH;
標(biāo)記:=1;
end
返多:標(biāo)記=1 and HIGH>高差價 and tholding>0,LINETHICK0;
高差價:=if(返多,HIGH,ref(高差價,1));
if LOW<高差價-1 and tholding>0 then begin
tsell(1,0,mkt);
標(biāo)記:=0;
高差價:=0;
end
if 空頭差 then begin
低差價:=LOW;
標(biāo)記:=-1;
end
返空:標(biāo)記=-1 and LOW<低差價 and tholding<0,LINETHICK0;
低差價:=if(返空,LOW,ref(低差價,1));
if HIGH>低差價-1 and tholding<0 then begin
tsellshort(1,0,mkt);
標(biāo)記:=0;
低差價:=0;
end
多頭價格參:高差價,LINETHICK0;
空頭價格參:低差價,LINETHICK0;
老師幫幫忙呀
if 多頭差 then begin
高差價:=HIGH;//記錄最近的一個滿足條件的H
標(biāo)記:=1;
end
........
高差價:=if(返多,HIGH,ref(高差價,1));
你的高差價本來就是一個全局變量,這里又 出現(xiàn)了ref(高差價,1),你想實(shí)現(xiàn)什么目的
高差價:=if(返多,HIGH,ref(高差價,1));
類似這種寫法,自身的值又賦值給自己,金字塔不支持這種寫法