老师,图表怎么修改编写成后台交易的 [金字塔]
- 咨询内容:
老师 请帮忙改一下,图表交易的转化为后台交易的,应该修改编写
DIFF := EMA(CLOSE,360) - EMA(CLOSE,1440);
DEA := EMA(DIFF,160);
macd_M5:= 2*(DIFF-DEA);MA1:MA(C,60),COLORRED;
S:= ABS(MA1-H)<=12*mindiff;
n:=10;//加仓次数
x:=3;//建仓手数
w:=5;kong:=S and macd_m5<0 ;
if kong then buyshort(holding=0,x,market);if kong and ENTERPRICE-C>=w*MINDIFF and abs(holding)=x then buyshort(1,x,market);
if kong and ENTERPRICE-C>=w*MINDIFF and abs(holding)=2*x then buyshort(1,x,market);
if kong and ENTERPRICE-C>=w*MINDIFF and abs(holding)=3*x then buyshort(1,x,market);
if kong and ENTERPRICE-C>=w*MINDIFF and abs(holding)=4*x then buyshort(1,x,market);
if kong and ENTERPRICE-C>=w*MINDIFF and abs(holding)=5*x then buyshort(1,x,market);
if macd_m5>0 and holding<0 then sellshort(1,0,market);//平空
- 金字塔客服:
前面的不变,后面的修改如下:
if kong then tbuyshort(tholding=0,x,mkt);
if kong and tENTERPRICE-C>=w*MINDIFF and abs(tholding)=x then tbuyshort(1,x,mkt);
if kong and tENTERPRICE-C>=w*MINDIFF and abs(tholding)=2*x then tbuyshort(1,x,mkt);
if kong and tENTERPRICE-C>=w*MINDIFF and abs(tholding)=3*x then tbuyshort(1,x,mkt);
if kong and tENTERPRICE-C>=w*MINDIFF and abs(tholding)=4*x then tbuyshort(1,x,mkt);
if kong and tENTERPRICE-C>=w*MINDIFF and abs(tholding)=5*x then tbuyshort(1,x,mkt);
if macd_m5>0 and tholding<0 then tsellshort(1,0,mkt);//平空 - 用户回复:
老师 问下 后台交易的 是在逐K线计算模式下 还是序列模式
- 网友回复:
一般序列,除非有特殊的函数,才会用到逐k
- 网友回复: 老师 就上面那个策略,我放在后台交易,为什么 会开仓了就马上平仓
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容