VARIABLE: aspect=0; //初始化假定做多头
VARIABLE: stopprice=0;//止损价格变量
VARIABLE: stopnum = 10; //止损价差
if barpos = 0 then
stopprice := l - stopnum;
if aspect = 0 then
begin
if l <= stopprice then
begin
aspect:= 1;
stopprice := h+stopnum;
end
if l - stopnum > stopprice then
stopprice := l-stopnum;
end
if aspect = 1 then
begin
if h >= stopprice then
begin
aspect:= 0;
stopprice := l-stopnum;
end
if h + stopnum < stopprice then
stopprice := h+stopnum;
end
//画线
PARTLINE( aspect = 0, stopprice , colorrgb(255,0,0));
PARTLINE( aspect = 1, stopprice , colorrgb(0,255,0));
请帮忙把上面的改为主图指标,序列模式。好引用
这个你编译的时候,会提示你使用逐k方式,你可以用逐k模式,不同模式下引用也没问题的。
或者选择不切换成逐k模式也行。
策略没什么可改的啊