如何在K線上畫出移動止損線 [金字塔]
- 咨詢內容:
老師好,下面是期指1分鐘交易代碼范本,我想在1分鐘K線圖上分別畫出固定止損線和移動止損線,請問代碼怎么實現,謝謝:
//中間變量
variable:highprice=0;
win1:=0;
win2:=0;//交易條件
kd:=kd1 and kd2;
pd:=pd1 and pd2 ;//交易系統
if kd then begin
sellshort(1,0,limitr,c);
buy(holding=0,1,limitr,c);
highprice:=enterprice;
zs:=enterprice-10;//10點固定止損
endif enterprice-c>=10 then 多損:sell(holding>0,0,limitr,zs);
if holding>0 then begin
if c>highprice then highprice:=c;
win1:=(c-enterprice)/enterprice*100;
win2:=(highprice-c)/(highprice-enterprice)*100;
if win1>0 and win1<=0.88 and win2>40 then begin
多回:sell(1,0,limitr,highprice-(highprice-enterprice)*0.4);
end
if win1>0.88 and win2>20 then begin
多贏:sell(1,0,limitr,highprice-(highprice-enterprice)*0.2);end
end - 金字塔客服:
drawsl(islastbar,enterprice-10,0,0,2)
- 用戶回復:
老師,我只想在有持倉的時候顯示止損線!另外一條移動止損線怎么畫?
- 網友回復:
有何需求請全部寫出來
- 網友回復: 老師,在上述代碼中,我想在有持倉的時候分別顯示固定止損和移動止損線和相應的點位,謝謝!
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 511411198 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容