MultiOrders





//+------------------------------------------------------------------+
//|                                                  MultiOrders.mq4 |
//|                                                             `Shu |
//|                                            http://SovetnikShu.ru |
//+------------------------------------------------------------------+
#property copyright "`Shu"
#property link      "http://SovetnikShu.ru"
// #property show_confirm
// #property show_inputs
#import "moo.dll"
  void ShowIn(double& Arr[]);
// #include <ShuLib.mq4>
extern int Magic=50005;
// #include <TF.mq4>
string shu=" [1.03] (c) `Shu [http://SovetnikShu.ru]";
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
  int start() 
  {
   int i;
   int t, tb, ts;
   int ssi;
   int f;
   int cmd;
   double d;
   double pr, sl, tp, lot;
   bool b;
   string s;
   string ss[5];
   string ord1[3];
   string ord[5][3];
   Print(WindowExpertName() + shu);
   //   if (false) { Qu(); QuTF(); }
   double Arr[5];
//----
   Arr[0]=1;
   Arr[1]=2;
   Arr[2]=3;
//----
   FileDelete("orders.txt");
   ShowIn(Arr);
   f=FileOpen("orders.txt", FILE_CSV|FILE_READ, "*");
//----
     if (f==-1) 
     {
      Alert("- íå ñìîãëè îòêðûòü ôàéë îðäåðîâ!");
      return(false);
     }
   ssi=0;
     while(!FileIsEnding(f)) 
     {
      s=FileReadString(f);
        if (s!="") 
        {
         ss[ssi]=s;
         ssi++;
        }
     }
   FileClose(f);
//----
     for(i=0; i < ssi; i++) 
     {
      Print(ss[i]);
      MassStr(ss[i], ";", ord1);
        if (ArraySize(ord1) < 3) 
        {
         // - åñëè êîììåíòà âäðóã íåò. ìàëî ëè?
         ArrayResize(ord1, 3);
         ord1[2]="";
        }
      ord[i][0]=ord1[0];
      ord[i][1]=StrRep(ord1[1], ",", ".");
      ord[i][2]=ord1[2];
        if (MarketInfo(ord[i][0], MODE_POINT)==0) 
        {
         Print("Íå ìîãó ïîëó÷èòü èíôîðìàöèþ î ñèìâîëå " + ord[i][0] + ". Ïðåêðàùàþ ðàáîòó!");
         return(false);
        }
     }
     for(i=0; i < ssi; i++) 
     {
      lot=StrToDouble(ord[i][1]);
      if (lot==0) continue;
      pr =iif(lot > 0, MarketInfo(ord[i][0], MODE_ASK), MarketInfo(ord[i][0], MODE_BID));
      cmd=iif(lot > 0, OP_BUY, OP_SELL);
      lot=MathAbs(lot);
      OrderSend(ord[i][0], cmd, lot, pr, 0, 0, 0, ord[i][2], Magic);
     }
//----
   return(0);
  }
// íà âõîäå:  ñòðîêà ñ ðàçäåëèòåëÿìè
// íà âûõîäå: ìàññèâ ñòðîê
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
  int MassStr( string s, string Ðàçäåëèòåëü, string& mass[])
  {
   int i;
   int Íàøëè;
   string s1;
//----
   ArrayResize(mass, 100);
   Íàøëè=0;
     while( s!="")
     {
      i=StringFind( s, Ðàçäåëèòåëü, 0);
      if(i==-1)i=255;
      s1=StringTrimRight(StringTrimLeft(StringSubstr( s, 0, i)) );
      s=StringTrimRight(StringTrimLeft(StringSubstr( s, i+1, 255)));
      mass[Íàøëè]=s1;
      Íàøëè++;
     }
   ArrayResize(mass, Íàøëè);
//----
   return(Íàøëè);
  }
// óñëîâíîå íàçíà÷åíèå DOUBLE (!)
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
  double iif( bool Óñëîâèå, double ÏåðâîåÇíà÷åíèå, double ÂòîðîåÇíà÷åíèå)
  {
   if (Óñëîâèå)      return(ÏåðâîåÇíà÷åíèå);
   else  return(ÂòîðîåÇíà÷åíèå);
  }
  string StrRep(string s, string old, string new) 
  {
   string r;
//----
   int i;
   int iOld, iNew;
   int ii;
//----
   string ss;
   iOld=StringGetChar(old, 0);
   iNew=StringGetChar(new, 0);
//----
   r="";
   ss=" ";
     for(i=0; i < StringLen(s); i++) 
     {
      ii=StringGetChar(s, i);
        if (ii==iOld) 
        {
         ss=StringSetChar(ss, 0, iNew);
        }
        else 
        {
         ss=StringSetChar(ss, 0, ii);
        }
      r=r + ss;
     }
//----
   return(r);
  }
//+------------------------------------------------------------------+





Sample





Analysis



Market Information Used:



Indicator Curves created:


Indicators Used:



Custom Indicators Used:
moo

Order Management characteristics:
It automatically opens orders when conditions are reached

Other Features:


Uses files from the file system
It issuies visual alerts to the screen
It reads information from a file

BackTest : EURUSD on H1

From 2009-08-01 to 2009-10-01 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2009-12-01 to 2010-01-17 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-03-01 to 2010-03-27 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-04-01 to 2010-04-30 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-05-01 to 2010-05-31 Profit Factor:0.00 Total Net Profit:0.00

BackTest : EURUSD on H1

From 2010-06-01 to 2010-06-30 Profit Factor:0.00 Total Net Profit:0.00

BackTest : GBPUSD on H1

From 2010-01-01 to 2010-02-27 Profit Factor:0.00 Total Net Profit:0.00

BackTest : USDCAD on H1

From 2009-01-01 to 2010-01-01 Profit Factor:0.00 Total Net Profit:0.00

BackTest : USDCAD on H1

From 2009-12-01 to 2010-01-01 Profit Factor:0.00 Total Net Profit:0.00

BackTest : USDCHF on H1

From 2009-12-01 to 2010-01-01 Profit Factor:0.00 Total Net Profit:0.00

BackTest : USDJPY on H1

From 2009-11-01 to 2009-11-30 Profit Factor:0.00 Total Net Profit:0.00

Request Backtest for MultiOrders


From : (yyyy/mm/dd) To: (yyyy/mm/dd)

Pair: Period: