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

MQL5 Komut dosyaları Entegrasyon

İş tamamlandı

Tamamlanma süresi: 2 dakika
Müşteri tarafından geri bildirim
very understanding and very fast
Geliştirici tarafından geri bildirim
Great customer! thanks for your order!

İş Gereklilikleri

            //+------------------------------------------------------------------+
//|                                                  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));
   }
 }
}
//+------------------------------------------------------------------+

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(68)
Projeler
124
40%
Arabuluculuk
17
47% / 53%
Süresi dolmuş
31
25%
Yüklendi
2
Geliştirici 2
Derecelendirme
(19)
Projeler
22
23%
Arabuluculuk
5
40% / 60%
Süresi dolmuş
2
9%
Çalışıyor
3
Geliştirici 3
Derecelendirme
(428)
Projeler
624
54%
Arabuluculuk
30
53% / 23%
Süresi dolmuş
6
1%
Meşgul
4
Geliştirici 4
Derecelendirme
(84)
Projeler
165
44%
Arabuluculuk
3
67% / 0%
Süresi dolmuş
5
3%
Çalışıyor
Yayınlandı: 1 kod
5
Geliştirici 5
Derecelendirme
(152)
Projeler
228
80%
Arabuluculuk
22
27% / 50%
Süresi dolmuş
11
5%
Serbest
Yayınlandı: 24 makale, 1882 kod
6
Geliştirici 6
Derecelendirme
(542)
Projeler
624
33%
Arabuluculuk
39
36% / 49%
Süresi dolmuş
11
2%
Meşgul
7
Geliştirici 7
Derecelendirme
(31)
Projeler
35
46%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
Yayınlandı: 3 kod
8
Geliştirici 8
Derecelendirme
Projeler
1
0%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
0
Serbest
9
Geliştirici 9
Derecelendirme
(265)
Projeler
596
35%
Arabuluculuk
64
20% / 58%
Süresi dolmuş
147
25%
Çalışıyor
Yayınlandı: 1 makale, 22 kod
10
Geliştirici 10
Derecelendirme
(43)
Projeler
66
12%
Arabuluculuk
12
58% / 42%
Süresi dolmuş
1
2%
Serbest
11
Geliştirici 11
Derecelendirme
(4)
Projeler
2
0%
Arabuluculuk
5
0% / 80%
Süresi dolmuş
1
50%
Serbest
12
Geliştirici 12
Derecelendirme
(102)
Projeler
105
60%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
13
Geliştirici 13
Derecelendirme
(33)
Projeler
35
20%
Arabuluculuk
5
40% / 40%
Süresi dolmuş
0
Serbest
Yayınlandı: 1 kod
14
Geliştirici 14
Derecelendirme
(3)
Projeler
6
17%
Arabuluculuk
0
Süresi dolmuş
3
50%
Serbest
15
Geliştirici 15
Derecelendirme
(15)
Projeler
18
6%
Arabuluculuk
8
38% / 38%
Süresi dolmuş
2
11%
Yüklendi
16
Geliştirici 16
Derecelendirme
(206)
Projeler
333
35%
Arabuluculuk
66
12% / 58%
Süresi dolmuş
87
26%
Serbest
17
Geliştirici 17
Derecelendirme
(449)
Projeler
476
69%
Arabuluculuk
6
67% / 0%
Süresi dolmuş
2
0%
Çalışıyor
18
Geliştirici 18
Derecelendirme
(302)
Projeler
308
69%
Arabuluculuk
2
100% / 0%
Süresi dolmuş
0
Serbest
Yayınlandı: 1 kod
19
Geliştirici 19
Derecelendirme
(568)
Projeler
642
40%
Arabuluculuk
2
100% / 0%
Süresi dolmuş
1
0%
Serbest
Yayınlandı: 9 kod
20
Geliştirici 20
Derecelendirme
(295)
Projeler
471
39%
Arabuluculuk
102
40% / 24%
Süresi dolmuş
78
17%
Meşgul
Yayınlandı: 2 kod
21
Geliştirici 21
Derecelendirme
Projeler
0
0%
Arabuluculuk
0
Süresi dolmuş
0
Serbest

Proje bilgisi

Bütçe
30+ USD
Son teslim tarihi
from 1 to 2 gün