A question for MQL connoisseurs - page 6

 
nikost:


ObjectCreate("DevIM0", OBJ_TRIANGLE, window, Time[0]+5500, 0,Time[0]+8500, 30,Time[0]+8500, -1*30);

The triangle is also quite good


Inserted your line. But I don't see any triangle in the window.
Maybe something else needs to be added?
ObjectSet etc. ?

int start()
  { 

ObjectCreate("DevIM0", OBJ_TRIANGLE,
 WindowFind(WindowExpertName()), Time[0]+5500, 0,Time[0]+8500, 30,Time[0]+8500, -1*30);  
       
                                             }                         

//-----------------------------------------------------   
    return(0);
  }
 
  ObjectCreate("asd", OBJ_LABEL, WindowFind(WindowExpertName()), 0,0);
  ObjectSetText("asd", '\x70', "Wingdings 3");// '\x71'
  ObjectSet("asd", OBJPROP_COLOR    , Red);
  ObjectSet("asd", OBJPROP_XDISTANCE, 10);
  ObjectSet("asd", OBJPROP_YDISTANCE, 10);
  ObjectSet("asd", OBJPROP_CORNER   , 3);
  ObjectSet("asd", OBJPROP_FONTSIZE , 18);
 
Rita:


Inserted your line. But I don't see the triangle in the box.
Maybe something else needs to be added?
ObjectSet etc. ?


It worked, finally:

 
xrust:


Thanks, xrust.

I'll look into it now.

 

Not quite clear again.

I drew a triangle in the indicator window:

#property indicator_separate_window

extern bool     ТРЕУГОЛЬНИК=true ;
int init()  {      return(0);  }
int deinit()  {   return(0);  }
int start()
  { 
     int counted_bars=IndicatorCounted();
  //---- проверка на возможные ошибки
     if(counted_bars<0) return(-1);
  //---- последний посчитанный бар будет пересчитан
     if(counted_bars>0) counted_bars-=10;
    //------------------------------------------------------------
   int limit=Bars - IndicatorCounted();  
   int k;    for(k = 0; k < limit; k++)   { 
.... .... ....  
 
  if (ТРЕУГОЛЬНИК==true )   
ObjectCreate("DevIM0", OBJ_TRIANGLE,
WindowFind(WindowExpertName()), Time[0]+3500, 0,Time[0]+9500, 0.2,Time[0]+9500, -1*0.2);  

     } 
//-----------------------------------------------------   
    return(0);
  }

However, the condition TRAGON==true is not seen by the indicator.

The triangle is always drawn, no matter what TRUE or FALSE I switch in the external parameters!

Why so ?

 

Do you remember to delete it in the deinité?

Is it unkosher to put brackets around the clause?

 

The brackets don't help.

In deinit, yes, it didn't. I'll put a deletion there now.

 

The brackets should be... and full stop :). or reverse the condition and retort :))

 

I put the brackets in. And did a deletion in Deinit.

The switch TRUE==true/false worked !

But now a new problem has turned up. On redrawing the triangle when changing its direction.

Now I will put the question here tomorrow.

 

You draw it on every tick...