1,出现开仓后,与开仓价格相比,最大损失超过1.5%止损
2,当出现最大盈利后,与最大盈利价格相比,回落40%幅度后止盈
谢金老师!
以多头为例,空头请根据多头的写法自行编写
1.
holding>0 and (enterprice-close)/enterprice>0.015
2.
holding>0 and hhv(h,entebars+1)-close/hhv(h,enterbars+1)>0.4
以下是引用jinzhe在2015/8/11 13:18:43的发言:
以多头为例,空头请根据多头的写法自行编写
1.
holding>0 and (enterprice-close)/enterprice>0.015
2.
holding>0 and hhv(h,entebars+1)-close/hhv(h,enterbars+1)>0.4
金老师早上好!
第二句好象不行啊,我用笨办法算过了,是个很大的数值,任何情况下都大于0.4
图表上几乎都是当天开平仓
多头止损:=(enterprice-close)/enterprice>止损幅度;
多头止盈:=hhv(h,enterbars+1)-close/hhv(h,enterbars+1)>止盈幅度;
空头止损:=(close-enterprice)/close>止损幅度;
空头止盈:=close/llv(l,enterbars+1)-llv(l,enterbars+1)>止盈幅度;
请问这样写行吗?
抱歉,逻辑不对了,第二个改成这样holding>0 and ((hhv(h,entebars+1)-enterprice)-(close-enterprice))/(hhv(h,enterbars+1)-enterprice)>0.4
[此贴子已经被作者于2015/8/12 9:13:51编辑过]
金老师,没关系的,谁又能没有失误呢。请问:注释掉止损止盈的时候,开平仓的信号是"极准确"的,一旦加进止损止盈,信号就乱套了,当天开平仓反复无常,请老师帮忙检查下面这样写对吗?
INPUT:n(20,1,300),ss(1,1,100),zs(0.02,0.01,0.035),zy(0.5,0.1,0.9);
多头止损:=(enterprice-close)/enterprice>zs;
多头止盈:=((hhv(h,enterbars+1)-enterprice)-(close-enterprice))/(hhv(h,enterbars+1)-enterprice)>zy;
空头止损:=(close-enterprice)/close>zs;
空头止盈:=(enterprice-(llv(l,enterbars+1))-(enterprice-close))/enterprice-(llv(l,enterbars+1))>zy;
//开仓规则控制=======================================
if holding=0 and 开多条件 THEN BEGIN
开多:BUY(1,ss,MARKET)COLORRED;
end
if holding=0 and 开空条件 THEN BEGIN
开空:BUYSHORT(1,ss,MARKET)COLORGREEN;
end
//止损止盈控制=======================================
if holding>0 and 多头止损 THEN BEGIN
多止:SELL(1,ss,MARKET)COLORYELLOW;
end
if holding>0 and 多头止盈 THEN BEGIN
多盈:SELL(1,ss,MARKET)COLORYELLOW;
end
//===================================================
if holding<0 and 空头止损 THEN BEGIN
空止:SELLSHORT(1,ss,MARKET)COLORYELLOW;
end
if holding<0 and 空头止盈 THEN BEGIN
空盈:SELLSHORT(1,ss,MARKET)COLORYELLOW;
end
用固定轮询的吗?要用走完k线模式
或者在固定轮询模式下,把多仓的close 改成low,把空仓的close改成high
以下是引用jinzhe在2015/8/12 13:23:00的发言:
用固定轮询的吗?要用走完k线模式
或者在固定轮询模式下,把多仓的close 改成low,把空仓的close改成high
是逐K模式,没有用序列
不是,我说的固定时间间隔和走完k线指的是这个,不是序列计算和逐k计算

此主题相关图片如下:1.png
打开图表程式化窗口检查了,默认的就是“走完一根K线后”