编写公式jxqs
ma5:ma(c,5);
ma10:ma(c,10);
ma20:ma(c,20);
if ma2>ma10 and ma10>ma20 then
dp:=1;
if ma5<ma10 and ma10<ma20 then
kp:=1;
if cross(ma(c,5),ma(c,10)) then
jc:=1;
if cross(ma(c,10),ma(c,5)) then
sc:=1;
编写交易系统
dtpl:stkindi('','jxqs.dp',0,3,-1);
ktpl:stkindi('','jxqs.kp',0,3,-1);
jjc:stkindi('','jxqs.jc',0,17,-1);
ssc:stkindi('','jxqs.sc',0,17,-1);
if dtpl and jjc then
buy(holding=0,1,market);
这个在图上不显示进出场点位,是怎么回事?
1,图表必须是一套完整的交易系统。及开平仓相结合,有开仓就应该有平仓。加上您平仓部分
编写公式jxqsma5:ma(c,5);
ma10:ma(c,10);
ma20:ma(c,20);
if ma2>ma10 and ma10>ma20 then
dp:=1;
if ma5<ma10 and ma10<ma20 then
kp:=1;
if cross(ma(c,5),ma(c,10)) then
jc:=1;
if cross(ma(c,10),ma(c,5)) then
sc:=1;
编写交易系统
dtpl:stkindi('','jxqs.dp',0,3,-1);
ktpl:stkindi('','jxqs.kp',0,3,-1);
jjc:stkindi('','jxqs.jc',0,17,-1);
ssc:stkindi('','jxqs.sc',0,17,-1);
if dtpl and jjc then
buy(holding=0,1,market);
if ssc then
sell(holding>0,1,market);
这个在图上不显示进出场点位,是怎么回事?
buyshort(ktpl and ssc,1,market);
sellshort(jjc,1,market);
开仓条件ktpl 和ssc 同时成立才可以,图上没有同时成立不显示进出场点位。
如果,KTPL和SSC两个条件,前一个先符合,等后一个符合就可以进场,这个怎么写呢?先谢谢了
也就是说,前一个是判断,后一个是具体进场点,这个怎么写呢?
用全局变量ktpl成立时记录下
VARIABLE:n:=0;
if KTPL then n:=1;
if n=1 and ssc THEN