이 코드에 구매 및 판매 화살표를 넣을 수 있도록 도와주세요. - 페이지 2

 
숙제 제안: OnDeinit() 함수에서 OBJ_ARROW_UP 및 OBJ_ARROW_DOWN 모든 개체를 제거하는 코드를 작성하십시오.
 

the same problem still persist. and i have added delete function. please help.


//+------------------------------------------------------------------+
//|                                                         Test.mq4 |
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_chart_window
//--- input parameter
sinput bool Alerts=TRUE;
//--- input parameters of the script 
input string            InpNameUP="ArrowUp";          // Sign name UP
input string            InpNameDOWN="ArrowDown";      // Sign name DOWN
input ENUM_ARROW_ANCHOR InpAnchorUP=ANCHOR_TOP;       // Anchor type 
input ENUM_ARROW_ANCHOR InpAnchorDOWN=ANCHOR_BOTTOM;  // Anchor type 
input color             InpColorUP=clrGreen;          // Sign color UP
input color             InpColorDOWN=clrRed;          // Sign color DOWN
input ENUM_LINE_STYLE   InpStyle=STYLE_DOT;           // Border line style 
input int               InpWidth=5;                   // Sign size 
input bool              InpBack=false;                // Background sign 
input bool              InpSelection=false;           // Highlight to move 
input bool              InpHidden=true;               // Hidden in the object list 
input long              InpZOrder=0;                  // Priority for mouse click 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit(void)
  {
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   static datetime prev;
   if(time[0]>prev) // new bar
     {
      //----
      if(Alerts)
        {
         if(close[4]>open[4] && close[3]>open[3] && close[2]>open[2] && close[1]<open[2])
           {
            string SELLSIGNAL=InpNameDOWN+(string)time[1];
            ArrowDownCreate(0,SELLSIGNAL,0,time[1],high[1],InpAnchorDOWN,InpColorDOWN,InpStyle,
                            InpWidth,InpBack,InpSelection,InpHidden);
/*if(ObjectFind(0,SELLSIGNAL)!=0)
              {
               ObjectCreate(SELLSIGNAL,OBJ_ARROW_DOWN,0,time[1],low[1]);
               ObjectSet(SELLSIGNAL,OBJPROP_WIDTH,5);
               //ObjectSet(SELLSIGNAL,OBJPROP_ARROWCODE,242);
               ObjectSet(SELLSIGNAL,OBJPROP_COLOR,clrRed);
               ObjectSetInteger(0,SELLSIGNAL,OBJPROP_ANCHOR,ANCHOR_TOP);
              }*/
           }
         else {
                  //--- delete the sign from the chart
                    ArrowUpDelete(0,InpNameDOWN);
                     ChartRedraw();
                  }
         
         
          if(close[4]<open[4] && close[3]<open[3] && close[2]<open[2] && close[1]>open[2])
           {
            string BUYSIGNAL=InpNameUP+(string)time[1];
            ArrowUpCreate(0,BUYSIGNAL,0,time[1],low[1],InpAnchorUP,InpColorUP,InpStyle,
                          InpWidth,InpBack,InpSelection,InpHidden);
/*if(ObjectFind(0,BUYSIGNAL)!=0)
                 {
                  ObjectCreate(BUYSIGNAL,OBJ_ARROW_UP,0,time[1],high[1]);
                  ObjectSet(BUYSIGNAL,OBJPROP_COLOR,clrBlue);
                  //ObjectSet(SELLSIGNAL,OBJPROP_ARROWCODE,241);
                  ObjectSet(BUYSIGNAL,OBJPROP_WIDTH,10);
                  ObjectSetInteger(0,BUYSIGNAL,OBJPROP_ANCHOR,ANCHOR_BOTTOM);
                 }*/
           }
           else {
                  //--- delete the sign from the chart
                    ArrowUpDelete(0,InpNameUP);
                     ChartRedraw();
                  }a
        }
     }
   prev=time[0];
//----
   return(rates_total);
  }
//+------------------------------------------------------------------+ 
//| Create Array Up sign                                             | 
//+------------------------------------------------------------------+ 
bool ArrowUpCreate(const long              chart_ID=0,           // chart's ID 
                   const string            name="ArrowUp",       // sign name 
                   const int               sub_window=0,         // subwindow index 
                   datetime                time=0,               // anchor point time 
                   double                  price=0,              // anchor point price 
                   const ENUM_ARROW_ANCHOR anchor=ANCHOR_BOTTOM, // anchor type 
                   const color             clr=clrRed,           // sign color 
                   const ENUM_LINE_STYLE   style=STYLE_SOLID,    // border line style 
                   const int               width=3,              // sign size 
                   const bool              back=false,           // in the background 
                   const bool              selection=true,       // highlight to move 
                   const bool              hidden=true,          // hidden in the object list 
                   const long              z_order=0)            // priority for mouse click 
  {
//--- reset the error value 
   ResetLastError();
//--- create the sign 
   if(!ObjectCreate(chart_ID,name,OBJ_ARROW_UP,sub_window,time,price))
     {
      Print(__FUNCTION__,
            ": failed to create \"Arrow Up\" sign! Error code = ",GetLastError());
      return(false);
     }
//--- set anchor type 
   ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,anchor);
//--- set a sign color 
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);
//--- set the border line style 
   ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style);
//--- set the sign size 
   ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,width);
//--- display in the foreground (false) or background (true) 
   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);
//--- enable (true) or disable (false) the mode of moving the sign by mouse 
//--- when creating a graphical object using ObjectCreate function, the object cannot be 
//--- highlighted and moved by default. Inside this method, selection parameter 
//--- is true by default making it possible to highlight and move the object 
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);
//--- hide (true) or display (false) graphical object name in the object list 
   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);
//--- set the priority for receiving the event of a mouse click in the chart 
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);
//--- successful execution 
   return(true);
  }
//+------------------------------------------------------------------+ 
//| Create Array Down sign                                           | 
//+------------------------------------------------------------------+ 
bool ArrowDownCreate(const long              chart_ID=0,           // chart's ID 
                     const string            name="ArrowDown",     // sign name 
                     const int               sub_window=0,         // subwindow index 
                     datetime                time=0,               // anchor point time 
                     double                  price=0,              // anchor point price 
                     const ENUM_ARROW_ANCHOR anchor=ANCHOR_BOTTOM, // anchor type 
                     const color             clr=clrRed,           // sign color 
                     const ENUM_LINE_STYLE   style=STYLE_SOLID,    // border line style 
                     const int               width=3,              // sign size 
                     const bool              back=false,           // in the background 
                     const bool              selection=true,       // highlight to move 
                     const bool              hidden=true,          // hidden in the object list 
                     const long              z_order=0)            // priority for mouse click 
  {
//--- reset the error value 
   ResetLastError();
//--- create the sign 
   if(!ObjectCreate(chart_ID,name,OBJ_ARROW_DOWN,sub_window,time,price))
     {
      Print(__FUNCTION__,
            ": failed to create \"Arrow Down\" sign! Error code = ",GetLastError());
      return(false);
     }
//--- anchor type 
   ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,anchor);
//--- set a sign color 
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);
//--- set the border line style 
   ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style);
//--- set the sign size 
   ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,width);
//--- display in the foreground (false) or background (true) 
   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);
//--- enable (true) or disable (false) the mode of moving the sign by mouse 
//--- when creating a graphical object using ObjectCreate function, the object cannot be 
//--- highlighted and moved by default. Inside this method, selection parameter 
//--- is true by default making it possible to highlight and move the object 
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);
//--- hide (true) or display (false) graphical object name in the object list 
   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);
//--- set the priority for receiving the event of a mouse click in the chart 
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);
//--- successful execution 
   return(true);
  }
//+------------------------------------------------------------------+
//| Delete Arrow Up sign                                             |
//+------------------------------------------------------------------+
bool ArrowUpDelete(const long   chart_ID=0,     // chart's ID
                   const string name="ArrowUp") // sign name
  {
//--- reset the error value
   ResetLastError();
//--- delete the sign
   if(!ObjectDelete(chart_ID,name))
     {
      Print(__FUNCTION__,
            ": failed to delete \"Arrow Up\" sign! Error code = ",GetLastError());
      return(false);
     }
//--- successful execution
   return(true);
  }
 //+------------------------------------------------------------------+
//| Delete Arrow Down sign                                           |
//+------------------------------------------------------------------+
bool ArrowDownDelete(const long   chart_ID=0,       // chart's ID
                     const string name="ArrowDown") // sign name
  {
//--- reset the error value
   ResetLastError();
//--- delete the sign
   if(!ObjectDelete(chart_ID,name))
     {
      Print(__FUNCTION__,
            ": failed to delete \"Arrow Down\" sign! Error code = ",GetLastError());
      return(false);
     }
//--- successful execution
   return(true);
  }
//+------------------------------------------------------------------+
 
춥다. OnDeinit() 함수 만 작성하면 됩니다. OnDeinit() 함수는 청소 일정을 유지합니다. 숙제: 접두사로 개체를 삭제하는 코드를 작성하십시오.
파일:
Test.mq4  10 kb
 

새로운 기술로 마이그레이션: MQL5 Storage( 프로젝트 - MetaEditor )에서 프로젝트를 사용합니다. 나는 당신을 위해 프로젝트를 만들었습니다:

영하디즈를 위한 프로젝트

 

완료했지만 아직 작동 하지 않습니다.





//+------------------------------------------------------------------+
//|                                                        TEST3.mq4 |
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link        "https://www.mql5.com"
#property version    "1.00"
#property strict
#property indicator_chart_window
//--- input parameter
sinput bool Alerts=TRUE;
//--- input parameters of the script 
input string             InpNameUP= "ArrowUp" ;           // Sign name UP
input string             InpNameDOWN= "ArrowDown" ;       // Sign name DOWN
input ENUM_ARROW_ANCHOR InpAnchorUP= ANCHOR_TOP ;       // Anchor type 
input ENUM_ARROW_ANCHOR InpAnchorDOWN= ANCHOR_BOTTOM ;   // Anchor type 
input color              InpColorUP= clrGreen ;           // Sign color UP
input color              InpColorDOWN= clrRed ;           // Sign color DOWN
input ENUM_LINE_STYLE    InpStyle= STYLE_DOT ;           // Border line style 
input int                InpWidth= 5 ;                   // Sign size 
input bool               InpBack= false ;                 // Background sign 
input bool               InpSelection= false ;           // Highlight to move 
input bool               InpHidden= true ;               // Hidden in the object list 
input long               InpZOrder= 0 ;                   // Priority for mouse click 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit ( void )
  {
   return ( INIT_SUCCEEDED );
  }
//+------------------------------------------------------------------+
//| Indicator                                                        |
//+------------------------------------------------------------------+
int OnCalculate ( const int rates_total,
                 const int prev_calculated,
                 const datetime &time[],
                 const double &open[],
                 const double &high[],
                 const double &low[],
                 const double &close[],
                 const long &tick_volume[],
                 const long &volume[],
                 const int &spread[])
  {
   static datetime prev;
   if (time[ 0 ]>prev) // new bar
     {
       //----
       if (Alerts)
        {
         if (close[ 4 ]>open[ 4 ] && close[ 3 ]>open[ 3 ] && close[ 2 ]>open[ 2 ] && close[ 1 ]<open[ 2 ])
           {
             string SELLSIGNAL=InpNameDOWN+( string )time[ 1 ];
            ArrowDownCreate( 0 ,SELLSIGNAL, 0 ,time[ 1 ],high[ 1 ],InpAnchorDOWN,InpColorDOWN,InpStyle,
                            InpWidth,InpBack,InpSelection,InpHidden);
           }
         else if (close[ 4 ]<open[ 4 ] && close[ 3 ]<open[ 3 ] && close[ 2 ]<open[ 2 ] && close[ 1 ]>open[ 2 ])
           {
             string BUYSIGNAL=InpNameUP+( string )time[ 1 ];
            ArrowUpCreate( 0 ,BUYSIGNAL, 0 ,time[ 1 ],low[ 1 ],InpAnchorUP,InpColorUP,InpStyle,
                          InpWidth,InpBack,InpSelection,InpHidden);
           }
        }
     }
   prev=time[ 0 ];
//----
   return (rates_total);
  }
//+------------------------------------------------------------------+ 
//| Create Array Up sign                                             | 
//+------------------------------------------------------------------+ 
bool ArrowUpCreate( const long               chart_ID= 0 ,           // chart's ID 
                   const string             name= "ArrowUp" ,       // sign name 
                   const int                sub_window= 0 ,         // subwindow index 
                   datetime                 time= 0 ,               // anchor point time 
                   double                   price= 0 ,               // anchor point price 
                   const ENUM_ARROW_ANCHOR anchor= ANCHOR_BOTTOM , // anchor type 
                   const color              clr= clrRed ,           // sign color 
                   const ENUM_LINE_STYLE    style= STYLE_SOLID ,     // border line style 
                   const int                width= 3 ,               // sign size 
                   const bool               back= false ,           // in the background 
                   const bool               selection= true ,       // highlight to move 
                   const bool               hidden= true ,           // hidden in the object list 
                   const long               z_order= 0 )             // priority for mouse click 
  {
//--- reset the error value 
   ResetLastError ();
//--- create the sign 
   if (! ObjectCreate (chart_ID,name, OBJ_ARROW_UP ,sub_window,time,price))
     {
       Print ( __FUNCTION__ ,
             ": failed to create \"Arrow Up\" sign! Error code = " , GetLastError ());
       return ( false );
     }
//--- set anchor type 
   ObjectSetInteger (chart_ID,name, OBJPROP_ANCHOR ,anchor);
//--- set a sign color 
   ObjectSetInteger (chart_ID,name, OBJPROP_COLOR ,clr);
//--- set the border line style 
   ObjectSetInteger (chart_ID,name, OBJPROP_STYLE ,style);
//--- set the sign size 
   ObjectSetInteger (chart_ID,name, OBJPROP_WIDTH ,width);
//--- display in the foreground (false) or background (true) 
   ObjectSetInteger (chart_ID,name, OBJPROP_BACK ,back);
//--- enable (true) or disable (false) the mode of moving the sign by mouse 
//--- when creating a graphical object using ObjectCreate function, the object cannot be 
//--- highlighted and moved by default. Inside this method, selection parameter 
//--- is true by default making it possible to highlight and move the object 
   ObjectSetInteger (chart_ID,name, OBJPROP_SELECTABLE ,selection);
   ObjectSetInteger (chart_ID,name, OBJPROP_SELECTED ,selection);
//--- hide (true) or display (false) graphical object name in the object list 
   ObjectSetInteger (chart_ID,name, OBJPROP_HIDDEN ,hidden);
//--- set the priority for receiving the event of a mouse click in the chart 
   ObjectSetInteger (chart_ID,name, OBJPROP_ZORDER ,z_order);
//--- successful execution 
   return ( true );
  }
//+------------------------------------------------------------------+ 
//| Create Array Down sign                                           | 
//+------------------------------------------------------------------+ 
bool ArrowDownCreate( const long               chart_ID= 0 ,           // chart's ID 
                     const string             name= "ArrowDown" ,     // sign name 
                     const int                sub_window= 0 ,         // subwindow index 
                     datetime                 time= 0 ,               // anchor point time 
                     double                   price= 0 ,               // anchor point price 
                     const ENUM_ARROW_ANCHOR anchor= ANCHOR_BOTTOM , // anchor type 
                     const color              clr= clrRed ,           // sign color 
                     const ENUM_LINE_STYLE    style= STYLE_SOLID ,     // border line style 
                     const int                width= 3 ,               // sign size 
                     const bool               back= false ,           // in the background 
                     const bool               selection= true ,       // highlight to move 
                     const bool               hidden= true ,           // hidden in the object list 
                     const long               z_order= 0 )             // priority for mouse click 
  {
//--- reset the error value 
   ResetLastError ();
//--- create the sign 
   if (! ObjectCreate (chart_ID,name, OBJ_ARROW_DOWN ,sub_window,time,price))
     {
       Print ( __FUNCTION__ ,
             ": failed to create \"Arrow Down\" sign! Error code = " , GetLastError ());
       return ( false );
     }
//--- anchor type 
   ObjectSetInteger (chart_ID,name, OBJPROP_ANCHOR ,anchor);
//--- set a sign color 
   ObjectSetInteger (chart_ID,name, OBJPROP_COLOR ,clr);
//--- set the border line style 
   ObjectSetInteger (chart_ID,name, OBJPROP_STYLE ,style);
//--- set the sign size 
   ObjectSetInteger (chart_ID,name, OBJPROP_WIDTH ,width);
//--- display in the foreground (false) or background (true) 
   ObjectSetInteger (chart_ID,name, OBJPROP_BACK ,back);
//--- enable (true) or disable (false) the mode of moving the sign by mouse 
//--- when creating a graphical object using ObjectCreate function, the object cannot be 
//--- highlighted and moved by default. Inside this method, selection parameter 
//--- is true by default making it possible to highlight and move the object 
   ObjectSetInteger (chart_ID,name, OBJPROP_SELECTABLE ,selection);
   ObjectSetInteger (chart_ID,name, OBJPROP_SELECTED ,selection);
//--- hide (true) or display (false) graphical object name in the object list 
   ObjectSetInteger (chart_ID,name, OBJPROP_HIDDEN ,hidden);
//--- set the priority for receiving the event of a mouse click in the chart 
   ObjectSetInteger (chart_ID,name, OBJPROP_ZORDER ,z_order);
//--- successful execution 
   return ( true );
  }
//+------------------------------------------------------------------+
//| Delete All Arrows                                                |
//+------------------------------------------------------------------+
bool ArrowDeleteAll( const long    chart_ID= 0 , // chart's ID
                     const    ENUM_OBJECT type= OBJ_ARROW_DOWN ) // type of objects
  {
//--- reset the error value
   ResetLastError ();
//--- delete the sign
   if (! ObjectsDeleteAll (chart_ID,- 1 ,type))
     {
       Print ( __FUNCTION__ ,
             ": failed to delete all " , EnumToString (type), "! Error code = " , GetLastError ());
       return ( false );
     }
//--- successful execution
   return ( true );
  }
  
  
//--------------------------------------------------------------------
//Function: DeleteObjectsByPrefix
//Purpose:  Deletes objects with prefix of passed string
//Inputs:   Prefix (string)
//Returns:  (void)
//--------------------------------------------------------------------
  
 void ObjectsDeletePrefixed( string sPrefix) {
   for ( int i= ObjectsTotal ()- 1 ; i>= 0 ; i--) {
     if ( StringFind ( ObjectName (i),sPrefix)== 0 ) ObjectDelete ( ObjectName (i));
  }
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
void OnDeinit ( const int reason)
  {
   ArrowDeleteAll( 0 , OBJ_ARROW_DOWN );
   ArrowDeleteAll( 0 , OBJ_ARROW_UP );
  }
  
//+------------------------------------------------------------------+
 
Karputov Vladimir 선생님, 내 게시물에 응답해 주십시오.
 
younghadiz :
Karputov Vladimir 선생님, 내 게시물에 응답해 주십시오.

도움말: ObjectsDeleteAll .

 

MetaEditor에서 "Projects" 폴더를 확인하십시오.

추신: 최적화를 위해 화살표를 그리는 막대의 수 를 제한해야 합니다.

하지만 오늘은 아닐 것입니다.

버전 "1.04" 파일을 첨부합니다.

파일:
Test.mq4  11 kb
 
선생님, 접두사 코드가 있지만 아직 작동하지 않습니다.


//+------------------------------------------------------------------+
//|                                                         Test.mq4 |
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link        "https://www.mql5.com"
#property version    "1.00"
#property strict
#property indicator_chart_window
//--- input parameter
sinput bool Alerts=TRUE;
//--- input parameters of the script 
input string             InpNameUP= "ArrowUp" ;           // Sign name UP
input string             InpNameDOWN= "ArrowDown" ;       // Sign name DOWN
input ENUM_ARROW_ANCHOR InpAnchorUP= ANCHOR_TOP ;       // Anchor type 
input ENUM_ARROW_ANCHOR InpAnchorDOWN= ANCHOR_BOTTOM ;   // Anchor type 
input color              InpColorUP= clrGreen ;           // Sign color UP
input color              InpColorDOWN= clrRed ;           // Sign color DOWN
input ENUM_LINE_STYLE    InpStyle= STYLE_DOT ;           // Border line style 
input int                InpWidth= 5 ;                   // Sign size 
input bool               InpBack= false ;                 // Background sign 
input bool               InpSelection= false ;           // Highlight to move 
input bool               InpHidden= true ;               // Hidden in the object list 
input long               InpZOrder= 0 ;                   // Priority for mouse click 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit ( void )
  {
   return ( INIT_SUCCEEDED );
  }
//+------------------------------------------------------------------+
//| Indicator                                                        |
//+------------------------------------------------------------------+
int OnCalculate ( const int rates_total,
                 const int prev_calculated,
                 const datetime &time[],
                 const double &open[],
                 const double &high[],
                 const double &low[],
                 const double &close[],
                 const long &tick_volume[],
                 const long &volume[],
                 const int &spread[])
  {
   static datetime prev;
   if (time[ 0 ]>prev) // new bar
     {
       //----
       if (Alerts)
        {
         if (close[ 4 ]>open[ 4 ] && close[ 3 ]>open[ 3 ] && close[ 2 ]>open[ 2 ] && close[ 1 ]<open[ 2 ])
           {
             string SELLSIGNAL=InpNameDOWN+( string )time[ 1 ];
            ArrowDownCreate( 0 ,SELLSIGNAL, 0 ,time[ 1 ],high[ 1 ],InpAnchorDOWN,InpColorDOWN,InpStyle,
                            InpWidth,InpBack,InpSelection,InpHidden);
           }
         else
            { ObjectsDeleteAll ( 0 , OBJ_ARROW_DOWN );
            
                     }
         
         
           if (close[ 4 ]<open[ 4 ] && close[ 3 ]<open[ 3 ] && close[ 2 ]<open[ 2 ] && close[ 1 ]>open[ 2 ])
           {
             string BUYSIGNAL=InpNameUP+( string )time[ 1 ];
            ArrowUpCreate( 0 ,BUYSIGNAL, 0 ,time[ 1 ],low[ 1 ],InpAnchorUP,InpColorUP,InpStyle,
                          InpWidth,InpBack,InpSelection,InpHidden);
           }
         else
            { ObjectsDeleteAll ( 0 , OBJ_ARROW_UP );
            
                     }
        }
     }
   prev=time[ 0 ];
//----
   return (rates_total);
  }
//+------------------------------------------------------------------+ 
//| Create Array Up sign                                             | 
//+------------------------------------------------------------------+ 
bool ArrowUpCreate( const long               chart_ID= 0 ,           // chart's ID 
                   const string             name= "ArrowUp" ,       // sign name 
                   const int                sub_window= 0 ,         // subwindow index 
                   datetime                 time= 0 ,               // anchor point time 
                   double                   price= 0 ,               // anchor point price 
                   const ENUM_ARROW_ANCHOR anchor= ANCHOR_BOTTOM , // anchor type 
                   const color              clr= clrRed ,           // sign color 
                   const ENUM_LINE_STYLE    style= STYLE_SOLID ,     // border line style 
                   const int                width= 3 ,               // sign size 
                   const bool               back= false ,           // in the background 
                   const bool               selection= true ,       // highlight to move 
                   const bool               hidden= true ,           // hidden in the object list 
                   const long               z_order= 0 )             // priority for mouse click 
  {
//--- reset the error value 
   ResetLastError ();
//--- create the sign 
   if (! ObjectCreate (chart_ID,name, OBJ_ARROW_UP ,sub_window,time,price))
     {
       Print ( __FUNCTION__ ,
             ": failed to create \"Arrow Up\" sign! Error code = " , GetLastError ());
       return ( false );
     }
//--- set anchor type 
   ObjectSetInteger (chart_ID,name, OBJPROP_ANCHOR ,anchor);
//--- set a sign color 
   ObjectSetInteger (chart_ID,name, OBJPROP_COLOR ,clr);
//--- set the border line style 
   ObjectSetInteger (chart_ID,name, OBJPROP_STYLE ,style);
//--- set the sign size 
   ObjectSetInteger (chart_ID,name, OBJPROP_WIDTH ,width);
//--- display in the foreground (false) or background (true) 
   ObjectSetInteger (chart_ID,name, OBJPROP_BACK ,back);
//--- enable (true) or disable (false) the mode of moving the sign by mouse 
//--- when creating a graphical object using ObjectCreate function, the object cannot be 
//--- highlighted and moved by default. Inside this method, selection parameter 
//--- is true by default making it possible to highlight and move the object 
   ObjectSetInteger (chart_ID,name, OBJPROP_SELECTABLE ,selection);
   ObjectSetInteger (chart_ID,name, OBJPROP_SELECTED ,selection);
//--- hide (true) or display (false) graphical object name in the object list 
   ObjectSetInteger (chart_ID,name, OBJPROP_HIDDEN ,hidden);
//--- set the priority for receiving the event of a mouse click in the chart 
   ObjectSetInteger (chart_ID,name, OBJPROP_ZORDER ,z_order);
//--- successful execution 
   return ( true );
  }
//+------------------------------------------------------------------+ 
//| Create Array Down sign                                           | 
//+------------------------------------------------------------------+ 
bool ArrowDownCreate( const long               chart_ID= 0 ,           // chart's ID 
                     const string             name= "ArrowDown" ,     // sign name 
                     const int                sub_window= 0 ,         // subwindow index 
                     datetime                 time= 0 ,               // anchor point time 
                     double                   price= 0 ,               // anchor point price 
                     const ENUM_ARROW_ANCHOR anchor= ANCHOR_BOTTOM , // anchor type 
                     const color              clr= clrRed ,           // sign color 
                     const ENUM_LINE_STYLE    style= STYLE_SOLID ,     // border line style 
                     const int                width= 3 ,               // sign size 
                     const bool               back= false ,           // in the background 
                     const bool               selection= true ,       // highlight to move 
                     const bool               hidden= true ,           // hidden in the object list 
                     const long               z_order= 0 )             // priority for mouse click 
  {
//--- reset the error value 
   ResetLastError ();
//--- create the sign 
   if (! ObjectCreate (chart_ID,name, OBJ_ARROW_DOWN ,sub_window,time,price))
     {
       Print ( __FUNCTION__ ,
             ": failed to create \"Arrow Down\" sign! Error code = " , GetLastError ());
       return ( false );
     }
//--- anchor type 
   ObjectSetInteger (chart_ID,name, OBJPROP_ANCHOR ,anchor);
//--- set a sign color 
   ObjectSetInteger (chart_ID,name, OBJPROP_COLOR ,clr);
//--- set the border line style 
   ObjectSetInteger (chart_ID,name, OBJPROP_STYLE ,style);
//--- set the sign size 
   ObjectSetInteger (chart_ID,name, OBJPROP_WIDTH ,width);
//--- display in the foreground (false) or background (true) 
   ObjectSetInteger (chart_ID,name, OBJPROP_BACK ,back);
//--- enable (true) or disable (false) the mode of moving the sign by mouse 
//--- when creating a graphical object using ObjectCreate function, the object cannot be 
//--- highlighted and moved by default. Inside this method, selection parameter 
//--- is true by default making it possible to highlight and move the object 
   ObjectSetInteger (chart_ID,name, OBJPROP_SELECTABLE ,selection);
   ObjectSetInteger (chart_ID,name, OBJPROP_SELECTED ,selection);
//--- hide (true) or display (false) graphical object name in the object list 
   ObjectSetInteger (chart_ID,name, OBJPROP_HIDDEN ,hidden);
//--- set the priority for receiving the event of a mouse click in the chart 
   ObjectSetInteger (chart_ID,name, OBJPROP_ZORDER ,z_order);
//--- successful execution 
   return ( true );
  }
//+------------------------------------------------------------------+
//| Delete All Arrows                                                |
//+------------------------------------------------------------------+
bool ArrowDeleteAll( const long    chart_ID= 0 , // chart's ID
                     const    ENUM_OBJECT type= OBJ_ARROW_DOWN ) // type of objects
  {
//--- reset the error value
   ResetLastError ();
//--- delete the sign
   if (! ObjectsDeleteAll (chart_ID,- 1 ,type))
     {
       Print ( __FUNCTION__ ,
             ": failed to delete all " , EnumToString (type), "! Error code = " , GetLastError ());
       return ( false );
     }
//--- successful execution
   return ( true );
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
void OnDeinit ( const int reason)
  {
   ArrowDeleteAll( 0 , OBJ_ARROW_DOWN );
   ArrowDeleteAll( 0 , OBJ_ARROW_UP );
  }
  
  
 int    ObjectsDeleteAll (
   long            chart_id,   // chart ID
   const string      prefix,   // prefix in object name
   int        sub_window=- 1 ,   // window index
   int       object_type=- 1      // object type
   );
//+------------------------------------------------------------------+
 

막대의 수 를 제한해야 합니다.

하지만 오늘은 아닐 것입니다.

버전 "1.04" 파일을 첨부합니다.