Need to convert mt4 script to mt5 for no demand no suuply

MQL5 Scripts Intégration

Tâche terminée

Temps d'exécution 2 minutes
Commentaires du client
very understanding and very fast
Commentaires de l'employé
Great customer! thanks for your order!

Spécifications

            //+------------------------------------------------------------------+
//|                                                  NSNDHistory.mq4 |
//|                      Copyright © 2011, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
extern int barcount=500;
extern int NSNDcount=10;
string comment[10];
static int prevtime=0;
static int prevfirstbar=0;
static double prevpricemax=0;
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------0-----------------------------+
int init()
  {
//---- indicators
f_clear();
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   f_clear();
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {

   int    counted_bars=IndicatorCounted();
   string Bull_or_Bear,obj_nameND;
   bool Low_Volume,Pins,Bear_Close_Below,Bull_Close_Above,Bear_Close_Above,Bull_Close_Below;
   string label;
   double chartheight=WindowPriceMax()-WindowPriceMin();
   double addhigh=6.00/100.00*chartheight;
//   Comment(WindowFirstVisibleBar(),"  ",prevfirstbar);
//----
  if(WindowFirstVisibleBar()!=prevfirstbar)
  {
   prevtime=0;
  }
  if(WindowPriceMax()!=prevpricemax)
  {
   prevtime=0;
  }
 
//  if(Time[0]!=prevtime) // | prevfirstbar!=WindowFirstVisibleBar())// && 11==2)
  {
   f_clear();
  //for(int i=barcount;i>=1;i--)
   for(int i=WindowFirstVisibleBar();i>=WindowFirstVisibleBar()-500 && i>=0 ;i--)
   {
    Bull_or_Bear=f_Bull_or_Bear(i);
    Low_Volume=f_Low_Volume(i);
    Pins=f_Pins(i,Bull_or_Bear);
  //  Comment(Bull_or_Bear," Low Volume ",Low_Volume,"  Pins ",Pins );
         Bear_Close_Below=false;
       Bear_Close_Above=false;
       Bull_Close_Above=false;
       Bull_Close_Below=false;
    for(int ix=i;ix>i-NSNDcount && ix>=0;ix--)
    {
       if(Bull_or_Bear=="Bear" && Close[ix]<Low[i] && !Bear_Close_Above)
       {
         Bear_Close_Below=true;
       }
       if(Bull_or_Bear=="Bear" && Close[ix]>High[i] && !Bear_Close_Below)
       {
         Bear_Close_Above=true;
       }
       if(Bull_or_Bear=="Bull" && Close[ix]>High[i] && !Bear_Close_Below)
       {
         Bull_Close_Above=true;
        }
       if(Bull_or_Bear=="Bull" && Close[ix]<Low[i] && !Bear_Close_Above)
       {
         Bull_Close_Below=true;
       }
    }//end for ix  
    label=TimeYear(Time[i])+DoubleToStr(TimeMonth(Time[i]),0)+DoubleToStr(TimeDay(Time[i]),0);
    label=label+DoubleToStr(TimeHour(Time[i]),0)+DoubleToStr(TimeMinute(Time[i]),0);  
    obj_nameND="No Demand - "+i+" - "+label;   ObjectDelete(obj_nameND);
    if(Bull_or_Bear=="Bull" && Low_Volume && Pins && !Bull_Close_Above && Bull_Close_Below)
    {
      ObjectCreate(obj_nameND,OBJ_TEXT,0,Time[i],High[i]+(addhigh));//+spread+0.0005);
      ObjectSetText(obj_nameND,"v",18,"Arial",Red);
      ObjectSet(obj_nameND,OBJPROP_PRICE1,High[i]+(addhigh));
      ObjectSet(obj_nameND,OBJPROP_TIME1,Time[i]);
      if(High[i]-Close[i]>Open[i]-Low[i])
      {
        ObjectSetText(obj_nameND,"v",18,"Arial",Red);
     }
    }
    obj_nameND="No Supply - "+i+" - "+label;   ObjectDelete(obj_nameND);
    if(Bull_or_Bear=="Bear" && Low_Volume && Pins && !Bear_Close_Below  && Bear_Close_Above)
    {
       string obj_nameNS="No Supply - "+i+" - "+label;
       ObjectCreate(obj_nameNS,OBJ_TEXT,0,Time[i],Low[i]);//-spread-0.0005);
       ObjectSetText(obj_nameNS,"^",22,"Arial",Lime);
       ObjectSet(obj_nameNS,OBJPROP_PRICE1,Low[i]);
       ObjectSet(obj_nameNS,OBJPROP_TIME1,Time[i]);
       if(High[i]-Open[i]<Close[i]-Low[i])
       {
       ObjectSetText(obj_nameNS,"^",18,"Arial",Lime);
       }
    }
    
   }//end for i 
   prevtime=Time[0];
   prevfirstbar=WindowFirstVisibleBar();
   prevpricemax=WindowPriceMax();
   }//endif if prevtime
//---- 

   return(0);
  }
  
string f_Bull_or_Bear(int i)
{
 string retvar;
    if(Open[i]>Close[i])
   {
       retvar="Bear";
       comment[i]=comment[i]+"Bear ";
   }
   if(Close[i]>Open[i])
   {
    retvar="Bull";
    comment[i]=comment[i]+"Bull ";
   }
 return(retvar);
}

bool f_Low_Volume(int i)
{
  bool retvar=False;
     if(Volume[i]<Volume[i+1] && Volume[i]<Volume[i+2])
     {
       retvar=True;
       comment[i]=comment[i]+"Low Vol ";
    }
 return(retvar);
}

bool f_Pins(int i,string Bull_or_Bear)
{
  bool Pins=false;
  double pip=Point*1;
  bool retval;
  if(Bull_or_Bear=="Bear" && High[i]>Open[i]+pip && Low[i]<Close[i]-pip)
  {
    retval=true;
    comment[i]=comment[i]+" Pins";
  }
  if(Bull_or_Bear=="Bull" && High[i]>Close[i]+pip && Low[i]<Open[i]-pip)
  {
    retval=true;
    comment[i]=comment[i]+" Pins";
  }
  return(retval);
}

void f_clear()
{
  for (int i=ObjectsTotal(); i>0; i--)
  
 {
   if(StringSubstr(ObjectName(i),0,2)=="No")
   {
    ObjectDelete(ObjectName(i));
   }
 }
   for (i=ObjectsTotal(); i>0; i--)
  
 {
   if(StringSubstr(ObjectName(i),0,2)=="No")
   {
    ObjectDelete(ObjectName(i));
   }
 }
}
//+------------------------------------------------------------------+

Répondu

1
Développeur 1
Évaluation
(68)
Projets
124
40%
Arbitrage
17
47% / 53%
En retard
31
25%
Chargé
2
Développeur 2
Évaluation
(19)
Projets
22
23%
Arbitrage
5
40% / 60%
En retard
2
9%
Travail
3
Développeur 3
Évaluation
(428)
Projets
624
54%
Arbitrage
30
53% / 23%
En retard
6
1%
Occupé
4
Développeur 4
Évaluation
(85)
Projets
166
43%
Arbitrage
3
67% / 0%
En retard
5
3%
Travail
Publié : 1 code
5
Développeur 5
Évaluation
(152)
Projets
228
80%
Arbitrage
22
27% / 50%
En retard
11
5%
Gratuit
Publié : 24 articles, 1882 codes
6
Développeur 6
Évaluation
(542)
Projets
624
33%
Arbitrage
39
36% / 49%
En retard
11
2%
Occupé
7
Développeur 7
Évaluation
(31)
Projets
35
46%
Arbitrage
0
En retard
0
Gratuit
Publié : 3 codes
8
Développeur 8
Évaluation
Projets
1
0%
Arbitrage
1
0% / 100%
En retard
0
Gratuit
9
Développeur 9
Évaluation
(265)
Projets
596
35%
Arbitrage
64
20% / 58%
En retard
147
25%
Travail
Publié : 1 article, 22 codes
10
Développeur 10
Évaluation
(43)
Projets
66
12%
Arbitrage
12
58% / 42%
En retard
1
2%
Gratuit
11
Développeur 11
Évaluation
(4)
Projets
2
0%
Arbitrage
5
0% / 80%
En retard
1
50%
Gratuit
12
Développeur 12
Évaluation
(102)
Projets
105
60%
Arbitrage
0
En retard
0
Gratuit
13
Développeur 13
Évaluation
(33)
Projets
35
20%
Arbitrage
5
40% / 40%
En retard
0
Gratuit
Publié : 1 code
14
Développeur 14
Évaluation
(3)
Projets
6
17%
Arbitrage
0
En retard
3
50%
Gratuit
15
Développeur 15
Évaluation
(15)
Projets
18
6%
Arbitrage
8
38% / 38%
En retard
2
11%
Chargé
16
Développeur 16
Évaluation
(206)
Projets
333
35%
Arbitrage
66
12% / 58%
En retard
87
26%
Gratuit
17
Développeur 17
Évaluation
(449)
Projets
476
69%
Arbitrage
6
67% / 0%
En retard
2
0%
Travail
18
Développeur 18
Évaluation
(302)
Projets
308
69%
Arbitrage
2
100% / 0%
En retard
0
Gratuit
Publié : 1 code
19
Développeur 19
Évaluation
(568)
Projets
642
40%
Arbitrage
2
100% / 0%
En retard
1
0%
Gratuit
Publié : 9 codes
20
Développeur 20
Évaluation
(295)
Projets
471
39%
Arbitrage
102
40% / 24%
En retard
78
17%
Occupé
Publié : 2 codes
21
Développeur 21
Évaluation
Projets
0
0%
Arbitrage
0
En retard
0
Gratuit

Informations sur le projet

Budget
30+ USD
Délais
de 1 à 2 jour(s)