Is the advisor suitable for real life? - page 52

 
YOUNGA:
Why are there no shorts?

The settings are separate, the plan is to put two EAs on the same account with directional separation, only the long test was cited.

It's about the same for shorts...

 

Short test for the same period. The lot is standard - 0.1. Maybe there are some pitfalls that I am not aware of please comment on this.


 

Hi all.

Does anyone trade cross indices?

 
double GetLot() {
  int i, FastPeriodMA = 7, SlowPeriodMA = 14, Coefficient = 2;

  static double Lot = 0;
  static double PrevBalance = 0;
  static double BalanceOld[0];
  static double BalanceNew[0];
  if (NormalizeDouble(PrevBalance - AccountBalance(), 2) != 0) {
    ArrayResize(BalanceNew, ArraySize(BalanceOld) + 1);
    for (i = 0; i <= ArraySize(BalanceOld) - 1; i++)
      BalanceNew[i] = BalanceOld[i];
    BalanceNew[ArraySize(BalanceOld)] = AccountBalance();
    ArrayResize(BalanceOld, ArraySize(BalanceOld) + 1);
    ArrayCopy(BalanceOld, BalanceNew);
    PrevBalance = AccountBalance();

    if (ArraySize(BalanceNew) > SlowPeriodMA) {
      double FastMA = 0, SlowMA = 0;
      for (i = ArraySize(BalanceNew) - FastPeriodMA; i <= ArraySize(BalanceNew) - 1; i++)
        FastMA += BalanceNew[i];
      FastMA /= FastPeriodMA;
      for (i = ArraySize(BalanceNew) - SlowPeriodMA; i <= ArraySize(BalanceNew) - 1; i++)
        SlowMA += BalanceNew[i];
      SlowMA /= SlowPeriodMA;
      if (FastMA > SlowMA) Lot *= 2;
      else Lot /= 2;
    }
  }
  if (Lot < MarketInfo(Symbol(), MODE_MINLOT)) Lot = MarketInfo(Symbol(), MODE_MINLOT);
  else if (Lot > MarketInfo(Symbol(), MODE_MAXLOT)) Lot = MarketInfo(Symbol(), MODE_MAXLOT);
  return (Lot);
}
 static double BalanceOld[0];
  static double BalanceNew[0];
выдает ошибку.Подправьте пожалуйста