[问题] 语法问题麻烦大家了

楼主: xxyyzzxyz627 (MrWUYUAN)   2016-05-14 14:35:23
var:KB(0),KS(0),mkp(0);
value1=Close of data2;
if date <> date[1] then begin
KB=0;
KS=0;
mkp=0;
end;
if marketposition=0 and value1 > 500 then begin buy("buy")
next bar at market;
if marketposition=0 and value1<-500 then begin sellshort("sell")
next bar at market;
if marketposition>0 then KB=1;
if marketposition<0 then KS=1;
end;
mkp=marketposition;
if mkp[1] <> 1 and mkp=1 then kb=kb+1;
if mkp[1] <> -1 and mkp=-1 then ks=ks+1;
if marketposition>0 then sell next bar at entryprice-20 stop;
if marketposition>0 then sell next bar at entryprice+20 stop;
if marketposition>0 then buytocover next bar at entryprice-20 stop;
if marketposition>0 then buytocover next bar at entryprice+20 stop;
if time>=1326 then sell("exitbuy1") this bar;
if time>=1326 then buytocover("exitshort1") this bar;
setexitonclose;
不好意思我里面写的内容是副图2指数高过500点做多停损停利都20点 跟低过500点 一天
多空进出场一次请问哪边写错了??
作者: aszs (o_o)   2016-05-14 15:33:00
看不懂你想问什么另外你的周期是多少啊
楼主: xxyyzzxyz627 (MrWUYUAN)   2016-05-14 18:02:00
我上面修改好了差一个END 但不会限制一天多空个进出一次 现在附图指数没大于500或小于500也进出不知道什么地方有错 多谢大大帮忙了
作者: goodddog (domiante)   2016-05-14 20:59:00
停利写法怪怪,应该用限价单而非停止单吧?
楼主: xxyyzzxyz627 (MrWUYUAN)   2016-05-15 07:06:00
非常谢谢大家最后都用好了 自己的第一支讯号非常高兴!!
作者: dodo222kimo (ㄎㄎ~嘟嘟胖 <>~~~)   2016-05-15 19:44:00
推语法 可以顺便学~

Links booklink

Contact Us: admin [ a t ] ucptt.com