打印本文打印本文 关闭窗口关闭窗口

开平仓问题

作者:金字塔 来源:cxh99.com 发布时间:2017年04月28日
  • 咨询内容: VARIABLE:bj=0; 
    if aspect=0 and holding=0 and bj=0 then begin     bj:=1;     buy(1,1,thisclose);endif H>=PBUY and C>=MAX(O,PBUY) AND MA1>REF(MA1,1) and holding=0  and bj=0 then begin     bj:=2;     buy(1,1,thisclose);end  if aspect=1 and holding>0 and bj=1 then begin    sell(1,0,thisclose);    bj:=0;end if C<stopprice and holding>0 and bj=2 then begin    sell(1,0,thisclose);    bj:=0;end
    if aspect=1 and holding=0 and bj=0 then begin     bj:=1;     BUYSHORT(1,1,thisclose);endif L<=PSELL and C<=MIN(O,PSELL) AND MA1<REF(MA1,1) and bj=0 then begin     bj:=2;     BUYSHORT(1,1,thisclose);end  if aspect=1 and holding>0 and bj=1 then begin    SELLSHORT(1,0,thisclose);    bj:=0;end if C<stopprice and holding>0 and bj=2 then begin    SELLSHORT(1,0,thisclose);    bj:=0;end
    k1的多单子用p1平仓k2的多单子用p2平仓
    Q1的空单子用D1平仓Q2的空单子用D2平仓开空同理。

     

  • 金字塔客服: 图标不显示

     

  • 用户回复: 你贴完整代码

     

  • 网友回复: 这样编写是正确?

     

  • 网友回复: 还是做空要另外使用一个变量?
打印本文打印本文 关闭窗口关闭窗口