想請教停損後反手做單的語法
各為版大您好~假設我的程式碼if time = 1045 and value10 + value12 = 2 then buy this bar c;
if time = 1045 and value10 + value12 = -2 then sellshort this bar c;
setpercenttrailing(200*500,0.5);
setstoploss(40000);
我有設單筆停損,請教如何要在停損後,反手做單的語法,該怎麼邊寫??
謝謝您
用set指令的話,就沒法反手吧
除非自己寫條件式來做停損停利,再進而去反手下單
paf 發表於 12-12-7 11:32 static/image/common/back.gif
用set指令的話,就沒法反手吧
除非自己寫條件式來做停損停利,再進而去反手下單
不好意思,請教一下,如果不用set的指令的話,改用別的程式碼來代替,應該要怎麼編寫呢??能否請您指導一下,如果邊寫停損後反手,不就要同時要先確認目前停損是因為做多或做空才停損的,之後才能反手做多或做空呢??
if maxcontractprofit > 500 * bigpointvalue and marketposition = 1 then begin
if highest(high,barsSinceEntry(0)) > highest(high,barsSinceEntry(0)) then
value1 = high; {記錄最高點}
{平倉用}
{sell next bar at (entryprice + value1) * 0.5 stop;}
{反手用}
sellshort next bar at(entryprice + value1) * 0.5 stop;
end;
if marketposition = 1 then
{反手}
sellshort next bar at entryprice - 200 * bigpointvalue stop;
簡略的寫法,不一定符合需要.最好是另外再加入進出場判斷再來反手比較好.
頁:
[1]