改为wh6文华 (文华财经WH6赢顺V6.7)

投资者咨询:改为wh6文华 (文华财经WH6赢顺V6.7)
来源:文华财经  日期:2018-7-23 21:20
 
  • Params

  •         Numeric ATime(918);

  •         Numeric CTime(1510);

  •         Numeric Lot(1);

  •         Numeric MoneyLoss(0.6);

  •         Numeric BarCross(1);

  •         Numeric Length(5);

  •        

  • Vars

  •         Numeric bTime(0);

  •         Numeric MyClose(0);

  •         Numeric MyDiff(0);

  •         NumericSeries estP(0);

  •         NumericSeries ExitP(0);

  •         NumericSeries Position(0);

  •         NumericSeries est(0);

  •         NumericSeries est1(0);

  •         NumericSeries est2(0);

  •         NumericSeries est3(0);

  •        

  •         Bool bTimeCon;

  •         Bool BarUpCon;

  •         Bool BarDownCon;

  •         Bool BarExitCon;

  •         Bool LongOpenCon;

  •         Bool ShortOpenCon;

  •         Bool LongExitCon;

  •         Bool ShortExitCon;

  •        

  • Begin

  •        

  •         If (Date != Date[1])

  •                 {

  •                         est = Open;

  •                         est1 = Open;

  •                         est2 = Open;

  •                         est3 = Open;

  •                         estP = 0;

  •                         ExitP = 0;

  •                         Position = 0;

  •                         MyClose = Open;

  •                 }

  •         Else

  •                 {

  •                         est = est[1];

  •                         est1 = est1[1];

  •                         est2 = est2[1];

  •                         est3 = est3[1];

  •                         estP = estP[1];

  •                         ExitP = ExitP[1];

  •                         Position = Position[1];

  •                         If(Length != 0) MyClose = Average(Close[1],Length);

  •                         Else MyClose = Close[1];

  •                 }

  •                

  •         MyDiff = MyClose * BarCross / 1000;

  •        

  •         bTime = IntPart(Time*10000);

  •         bTimeCon = (bTime > ATime) And (bTime < CTime);

  •        

  •         If((MyClose < est And MyClose < est1) Or (MyClose > est And MyClose > est1)) est = MyClose;

  •         If(((MyClose - est) > MyDiff And est < est1) Or ((est - MyClose) > MyDiff And est > est1))

  •                 {

  •                         est3 = est2;

  •                         est2 = est1;

  •                         est1 = est;

  •                         est = MyClose;

  •                 }

  •                

  •         If(Position > 0 And High > estP) estP = High;

  •         If(Position < 0 And Low < estP) estP = Low;

  •         If(Position > 0) ExitP = estP * (100 - MoneyLoss) / 100;

  •         If(Position < 0) ExitP = estP * (100 MoneyLoss) / 100;

  •        

  •         If(bTime >= CTime)

  •         {

  •                 If (Position > 0)

  •                         Sell(lot,Open);

  •                 Else

  •                         BuyToCover(lot,Open);

  •         }

  •          

  •         If(bTimeCon)

  •         {

  •                 If (Position == 0)

  •                 {

  •                         If(est3 < est1 And (est2 / 2000 est2) <= est And est3 < est2)

  •                         {

  •                                 Buy(lot,Open);

  •                                 Position = lot;

  •                                 estP = Open;

  •                                 ExitP = estP * (100 - MoneyLoss) / 100;

  •                                 Commentary("LongOpen");

  •                                

  •                         }

  •                          

  •                         Else If(est3 > est1 And (est2 - est2 / 2000) >= est And est3 > est2)

  •                         {

  •                                 SellShort(lot,Open);

  •                                 Position = lot * -1;

  •                                 estP = Open;

  •                                 ExitP = estP * (100 MoneyLoss) / 100;

  •                                 Commentary("ShortOpen");

  •                         }

  •                 }

  •                

  •                 Else

  •                

  •                 {

  •                         If(Position > 0 And est3 > est1)

  •                         {

  •                                 Sell(lot,Open);

  •                                 Position = 0;

  •                                 Commentary("LongExit1");

  •                         }

  •                        

  •                         Else If(Position < 0 And est3 < est1)

  •                         {

  •                                 BuyToCover(lot,Open);

  •                                 Position = 0;

  •                                 Commentary("ShortExit1");

  •                         }

  •                        

  •                         Else If(Position > 0 And Open < ExitP)

  •                         {

  •                                 Sell(lot,Open);

  •                                 Position = 0;

  •                                 Commentary("LongExit2");

  •                         }

  •                        

  •                         Else If(Position < 0 And Open > ExitP)

  •                         {

  •                                 BuyToCover(lot,Open);

  •                                 Position = 0;

  •                                 Commentary("ShortExit2");

  •                         }

  •                 }

  •         }

  •        

  •         Commentary("Position = " Text(Position));

  •         Commentary("ExitP = " Text(ExitP));

  • End
  • 技术人员回复
    日期:2018-7-23 22:17
     6中不支持的,需要在mq中实现的,给您改写在mq中使用的模型可以吗?
    投资者咨询:改为wh6文华 (文华财经WH6赢顺V6.7)
    来源:文华财经  日期:2018-7-23 21:20

    可以

    技术人员回复
    日期:2018-8-1 21:39
     MQ模型改写较复杂,明日工作时间由相关老师给您回复
    技术人员回复
    日期:2018-8-2 9:57
     上面语法是不完整的,

    例如:   If(est3 < est1 And (est2 / 2000 est2) <= est And est3 < est2)

    中间是缺少运算符号的,您补充完整后我们再帮您分析下