bk:=c>ma(c,20);
价格低于开仓时的前第三根低点是止损平仓,
提取开仓时前第三根K线的低点,作为常量记住,如何实现
我也在学习中,是不是用BARPOS可以实现?
取当前K线的值,然后减去3就是那根K线的位置,取那个位置的最低价
bk:=c>MA(c,20);
{开多}ENTERLONG:bk,TFILTER;
if bk then
BEGIN
LL:=LOW[BARPOS-3];
END
{平多EXITLONG:LL,TFILTER;
无信号出现,请高手指正,谢谢,这个问题是我提的,请帮忙!
你这个要求必须要使用BUY,SELL等高端图表交易的逐周期才能正常工作。
runmode:0;
variable:stopprice=0;
if holding=0 then begin
if close>ma(close,20) then begin
buy(1,1,limitr,close);
stopprice:=low[barpos-3];
end
end
if holding>0 then begin
if low<=stopprice then begin
sell(1,holding,limitr,stopprice);
stopprice:=0;
end
end