如何在K線上畫出移動(dòng)止損線 [金字塔]
- 咨詢內(nèi)容:
老師好,下面是期指1分鐘交易代碼范本,我想在1分鐘K線圖上分別畫出固定止損線和移動(dòng)止損線,請(qǐng)問代碼怎么實(shí)現(xiàn),謝謝:
//中間變量
variable:highprice=0;
win1:=0;
win2:=0;//交易條件
kd:=kd1 and kd2;
pd:=pd1 and pd2 ;//交易系統(tǒng)
if kd then begin
sellshort(1,0,limitr,c);
buy(holding=0,1,limitr,c);
highprice:=enterprice;
zs:=enterprice-10;//10點(diǎn)固定止損
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)
- 用戶回復(fù):
老師,我只想在有持倉的時(shí)候顯示止損線!另外一條移動(dòng)止損線怎么畫?
- 網(wǎng)友回復(fù):
有何需求請(qǐng)全部寫出來
- 網(wǎng)友回復(fù): 老師,在上述代碼中,我想在有持倉的時(shí)候分別顯示固定止損和移動(dòng)止損線和相應(yīng)的點(diǎn)位,謝謝!
有思路,想編寫各種指標(biāo)公式,程序化交易模型,選股公式,預(yù)警公式的朋友
可聯(lián)系技術(shù)人員 QQ: 511411198 進(jìn)行 有償 編寫!(不貴!點(diǎn)擊查看價(jià)格!)
相關(guān)文章
-
沒有相關(guān)內(nèi)容