" CreatePitchfork & SetPitchfork " how set it to : do not draw levels ?

 

i used bellow line to draw pitchfork .

as you see in picture below, level line also draw with it.

how can set it to undo like this, ( do not draw level lines )


.
.
//+------------------------------------------------------------------+
//|  Pitchfork creation                                              |
//+------------------------------------------------------------------+
void CreatePitchfork(long     chart_id_Pitchfork,  // chart ID
                     string   name_Pitchfork,      // object name
                     int      nwin_Pitchfork,      // window index
                     datetime time1_Pitchfork,     // price level time 1
                     double   price1_Pitchfork,    // price level 1
                     datetime time2_Pitchfork,     // price level time 2
                     double   price2_Pitchfork,    // price level 2
                     datetime time3_Pitchfork,     // price level time 3
                     double   price3_Pitchfork,    // price level 3
                     color    Color_Pitchfork,     // line color
                     int      style_Pitchfork,     // line style
                     int      width_Pitchfork,     // line width
                     string   text_Pitchfork)      // text
  {
//----
   ObjectCreate(chart_id_Pitchfork,name_Pitchfork,OBJ_PITCHFORK,nwin_Pitchfork,time1_Pitchfork,price1_Pitchfork
                ,time2_Pitchfork,price2_Pitchfork,time3_Pitchfork,price3_Pitchfork);
   ObjectSetInteger(chart_id_Pitchfork,name_Pitchfork,OBJPROP_RAY_RIGHT,false);
   ObjectSetInteger(chart_id_Pitchfork,name_Pitchfork,OBJPROP_RAY_LEFT,false);
   ObjectSetInteger(chart_id_Pitchfork,name_Pitchfork,OBJPROP_COLOR,Color_Pitchfork);
   ObjectSetInteger(chart_id_Pitchfork,name_Pitchfork,OBJPROP_STYLE,style_Pitchfork);
   ObjectSetInteger(chart_id_Pitchfork,name_Pitchfork,OBJPROP_WIDTH,width_Pitchfork);
   ObjectSetString(chart_id_Pitchfork,name_Pitchfork,OBJPROP_TEXT,text_Pitchfork);
   ObjectSetInteger(chart_id_Pitchfork,name_Pitchfork,OBJPROP_BACK,true);
//----
  }
//+------------------------------------------------------------------+
//|  Pitchfork reinstallation                                        |
//+------------------------------------------------------------------+
void SetPitchfork(long     chart_id_Pitchfork,  // chart ID
                  string   name_Pitchfork,      // object name
                  int      nwin_Pitchfork,      // window index
                  datetime time1_Pitchfork,     // price level time 1
                  double   price1_Pitchfork,    // price level 1
                  datetime time2_Pitchfork,     // price level time 2
                  double   price2_Pitchfork,    // price level 2
                  datetime time3_Pitchfork,     // price level time 3
                  double   price3_Pitchfork,    // price level 3
                  color    Color_Pitchfork,     // line color
                  int      style_Pitchfork,     // line style
                  int      width_Pitchfork,     // line width
                  string   text_Pitchfork)      // text
  {
//----
   if(ObjectFind(chart_id_Pitchfork,name_Pitchfork)==-1) CreatePitchfork(chart_id_Pitchfork,name_Pitchfork
         ,nwin_Pitchfork,time1_Pitchfork,price1_Pitchfork,time2_Pitchfork,price2_Pitchfork
         ,time3_Pitchfork,price3_Pitchfork,Color_Pitchfork,style_Pitchfork,width_Pitchfork,text_Pitchfork);
   else
     {
      ObjectSetString(chart_id_Pitchfork,name_Pitchfork,OBJPROP_TEXT,text_Pitchfork);
      ObjectMove(chart_id_Pitchfork,name_Pitchfork,0,time1_Pitchfork,price1_Pitchfork);
      ObjectMove(chart_id_Pitchfork,name_Pitchfork,1,time2_Pitchfork,price2_Pitchfork);
      ObjectMove(chart_id_Pitchfork,name_Pitchfork,2,time3_Pitchfork,price3_Pitchfork);
     }
//----
  }
//+------------------------------------------------------------------+ 
.
.
.

thank you.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Drawing Styles
Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Drawing Styles
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Drawing Styles - Documentation on MQL5
 
use lines pitchfork to do what. see it we can buy or sell in market , can we. thanks share
 
hoan:
use lines pitchfork to do what. see it we can buy or sell in market , can we. thanks share

that's a little part of my strategy. ( i working on it )

i want that :

 with use this method to draw pitchfork ; the level line dose not appear on chart. 

is it possible ?

 

For create Triangle you can use below code:

void CreateTRIANGLE(int     chart_id,  // Chart identifier
                  string   name,      // object name
                       // Chart window
                  datetime  time1,        // First time coordinate
                  double    price1,       // First price coordinate
                  datetime  time2,        // Second time coordinate
                  double    price2,       // Second price coordinate
                  datetime  time3,        // Third time coordinate
                  double    price3,        // Third price coordinate
                  color    Color=clrGreenYellow,     // Fill color
                  int      style=STYLE_SOLID,     // line style
                  int      width=1     // line width
                  ) 
                   {
  ObjectCreate(chart_id,name, OBJ_TRIANGLE, 0, 0,0);
 
   ObjectSetInteger(chart_id,name,OBJPROP_COLOR,Color);
   ObjectSetInteger(chart_id,name,OBJPROP_STYLE,style);
   ObjectSetInteger(chart_id,name,OBJPROP_WIDTH,width);
  
   ObjectSetInteger(chart_id,name,OBJPROP_TIME,time1);
   ObjectSetInteger(chart_id,name,OBJPROP_TIME,1,time2);
   ObjectSetInteger(chart_id,name,OBJPROP_TIME,2,time3);
   ObjectSetInteger(chart_id,name,OBJPROP_FILL,1);
    ObjectSetDouble(chart_id,name,OBJPROP_PRICE,price1);
    ObjectSetDouble(chart_id,name,OBJPROP_PRICE,1,price2);
    ObjectSetDouble(chart_id,name,OBJPROP_PRICE,2,price3);
}

 
TIMisthebest:

i used bellow line to draw pitchfork .

as you see in picture below, level line also draw with it.

how can set it to undo like this, ( do not draw level lines )


thank you.

Hi mehrdad

  This syntax  for create object is not correct

ObjectCreate(chart_id_Pitchfork,name_Pitchfork,OBJ_PITCHFORK,nwin_Pitchfork,time1_Pitchfork,price1_Pitchfork
                ,time2_Pitchfork,price2_Pitchfork,time3_Pitchfork,price3_Pitchfork);

This syntax for create object 

bool  ObjectCreate(
   long         chart_id,      // chart identifier
   string       name,          // object name
   ENUM_OBJECT  type,          // object type
   sub_window   nwin,          // window index
   datetime     time1,         // time of the first anchor point
   double       price1,        // price of the first anchor point
   ...
   datetime     timeN=0,       // time of the N-th anchor point
   double       priceN=0,      // price of the N-th anchor point
   ...
   datetime     time30=0,      // time of the 30th anchor point
   double       price30=0      // price of the 30th anchor point

   );

For more information, please visit this page : https://www.mql5.com/en/docs/objects/objectcreate



Documentation on MQL5: Object Functions / ObjectCreate
Documentation on MQL5: Object Functions / ObjectCreate
  • www.mql5.com
Object Functions / ObjectCreate - Documentation on MQL5
 

Hi

I modify your code 


Files:
myzigzag.mq5  23 kb
 

And This code for PITCHFORK


 void CreateFork(int     chart_id,  // Chart identifier
                  string   name,      // object name
                  datetime  time1,        // First time coordinate
                  double    price1,       // First price coordinate
                  datetime  time2,        // Second time coordinate
                  double    price2,       // Second price coordinate
                  datetime  time3,        // Third time coordinate
                  double    price3,        // Third price coordinate
                  int       level=0,        // Level number
                  color    Color=clrGreenYellow,     // line color
                  int      style=STYLE_SOLID,     // line style
                  int      width=1     // line width
                  ) 
                   {
  ObjectCreate(chart_id,name, OBJ_PITCHFORK, 0, 0,0);
 
   ObjectSetInteger(chart_id,name,OBJPROP_COLOR,Color);
   ObjectSetInteger(chart_id,name,OBJPROP_STYLE,style);
   ObjectSetInteger(chart_id,name,OBJPROP_WIDTH,width);
  
   ObjectSetInteger(chart_id,name,OBJPROP_TIME,time1);
   ObjectSetInteger(chart_id,name,OBJPROP_TIME,1,time2);
   ObjectSetInteger(chart_id,name,OBJPROP_TIME,2,time3);
   ObjectSetInteger(chart_id,name,OBJPROP_FILL,1);
    ObjectSetDouble(chart_id,name,OBJPROP_PRICE,price1);
    ObjectSetDouble(chart_id,name,OBJPROP_PRICE,1,price2);
     ObjectSetDouble(chart_id,name,OBJPROP_PRICE,2,price3);
   
 ObjectSetInteger(chart_id,name,OBJPROP_LEVELS,level);


 

And Final code


Files:
myzigzag.mq5  25 kb
 
kourosh1347:

And Final code

thank you very much,
 
kourosh1347, thank you for helping TIMisthebest
 
phi.nuts:
kourosh1347, thank you for helping TIMisthebest
  your welcome
Reason: