1.你什么周期的。日线或者较大的周期的处理和小周期不一样
2.“高点H赋值为当日H” 这里,实现不了。不能用代码修改K线数据。
H_3:=callstock('',vthigh,6,-3);
H_2=callstock('',vthigh,6,-2);
K:=if(time>110000 and time <113000,hhv(h,barslast(time=110000)),999999999);
if H_3>H_2 and H_2>K and time>110000 and time <113000 then DRAWICON();
具体这个标记部分您自行完成
H_3:=callstock('',vthigh,6,-3); H_2=callstock('',vthigh,6,-2); K:=if(time>110000 and time <113000,hhv(h,barslast(time=110000)),999999999); if H_3>H_2 and H_2>K and time>110000 and time <113000 then DRAWICON();
具体这个标记部分您自行完成 老师,您编写的代码有问题, 我用国中水务600187 2017/04/20 最高价 6.37 21日最高价5.93,而24日11点——11点30之前的C最高收5.7,而当日最高收5.82,那么并没有K赋值成5.82,。 |
日线周期下time函数的判断会失效。你这个在日线下有问题的。
你用小周期去运行这段代码才行。
如果想要记住那个值的话。可以把K值用全局变量保存下。
variable:s:=0;
H_3:=callstock('',vthigh,6,-3); H_2=callstock('',vthigh,6,-2);
if time>110000 and time <113000 then
if H_3>H_2 and H_2>s and time>110000 and time <113000 then DRAWICON(); |
showS:s;