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

MQL5 스크립트 통합

작업 종료됨

실행 시간 2 분
고객의 피드백
very understanding and very fast
피고용인의 피드백
Great customer! thanks for your order!

명시

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

응답함

1
개발자 1
등급
(68)
프로젝트
124
40%
중재
17
47% / 53%
기한 초과
31
25%
로드됨
2
개발자 2
등급
(19)
프로젝트
22
23%
중재
5
40% / 60%
기한 초과
2
9%
작업중
3
개발자 3
등급
(428)
프로젝트
624
54%
중재
30
53% / 23%
기한 초과
6
1%
바쁜
4
개발자 4
등급
(84)
프로젝트
165
44%
중재
3
67% / 0%
기한 초과
5
3%
작업중
게재됨: 1 코드
5
개발자 5
등급
(152)
프로젝트
228
80%
중재
22
27% / 50%
기한 초과
11
5%
무료
게재됨: 24 기고글, 1882 코드
6
개발자 6
등급
(542)
프로젝트
624
33%
중재
39
36% / 49%
기한 초과
11
2%
바쁜
7
개발자 7
등급
(31)
프로젝트
35
46%
중재
0
기한 초과
0
무료
게재됨: 3 코드
8
개발자 8
등급
프로젝트
1
0%
중재
1
0% / 100%
기한 초과
0
무료
9
개발자 9
등급
(265)
프로젝트
596
35%
중재
64
20% / 58%
기한 초과
147
25%
작업중
게재됨: 1 기고글, 22 코드
10
개발자 10
등급
(43)
프로젝트
66
12%
중재
12
58% / 42%
기한 초과
1
2%
무료
11
개발자 11
등급
(4)
프로젝트
2
0%
중재
5
0% / 80%
기한 초과
1
50%
무료
12
개발자 12
등급
(102)
프로젝트
105
60%
중재
0
기한 초과
0
무료
13
개발자 13
등급
(33)
프로젝트
35
20%
중재
5
40% / 40%
기한 초과
0
무료
게재됨: 1 코드
14
개발자 14
등급
(3)
프로젝트
6
17%
중재
0
기한 초과
3
50%
무료
15
개발자 15
등급
(15)
프로젝트
18
6%
중재
8
38% / 38%
기한 초과
2
11%
로드됨
16
개발자 16
등급
(206)
프로젝트
333
35%
중재
66
12% / 58%
기한 초과
87
26%
무료
17
개발자 17
등급
(449)
프로젝트
476
69%
중재
6
67% / 0%
기한 초과
2
0%
작업중
18
개발자 18
등급
(302)
프로젝트
308
69%
중재
2
100% / 0%
기한 초과
0
무료
게재됨: 1 코드
19
개발자 19
등급
(568)
프로젝트
642
40%
중재
2
100% / 0%
기한 초과
1
0%
무료
게재됨: 9 코드
20
개발자 20
등급
(295)
프로젝트
471
39%
중재
102
40% / 24%
기한 초과
78
17%
바쁜
게재됨: 2 코드
21
개발자 21
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료

프로젝트 정보

예산
30+ USD
기한
에서 1  2 일