咨詢內容:
就是夜盤9點到白盤下午3點之間,虧損1000停止程序當天的開平倉操作,這個公式要怎講寫呢
?
?來源: m.kzuj.com.cn
金字塔資深技術:
這種操作需要在后臺程序化中實現。使用此條件作為開倉平倉條件的一種。TACCOUNT(30)<-1000.
圖表只能算理論值,大致思路如下,使用全局變量記錄每天的累計平倉盈虧。
variable:yingkui=0;
jaiwei:=-1000;
ma5:ma(close,5);
ma20:ma(close,20);
cond1:cross(ma5,ma20);
cond2:cross(ma20,ma5);
if cond2 and holding>0 then
begin
??sell(1,1,thisclose);
??yingkui:=yingkui+NUMPROFIT(1);
end
if cond1 and holding=0 and yingkui>jaiwei then??buy(1,1,thisclose);
if time=closetime(0) then yingkui:=0;
AA:yingkui;
技術交流:
老師,移動止損怎么寫,移動止損100怎么編寫
?
技術交流:
范例代碼如下:參照學習后嘗試修改
DTYDZS:=(HHV(H,ENTERBARS)-CLOSE)/AVGENTERPRICE>=0.1;
KTYDZS:=(CLOSE-LLV(L,ENTERBARS))/AVGENTERPRICE>=0.1;
SELL(DTYDZS,0,MARKET);
SELLSHORT(KTYDZS,0,MARKET);