[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 71

 

How can I add text to the existing text in OBJ_LABEL?

That is, with each update the Expert Advisor should not replace the line, but add a new one. So that the text will run on the screen as a result)

 
luka >> :

How can I add text to the existing text in OBJ_LABEL?

That is, with each update the Expert Advisor should not replace the line, but add a new one. In order to have a text on the screen as a result)

There are a lot of ways.

For example, form a string in a separate variable and use the object only for output, not for storing the previous value.

 

Hello.

Please tell me how to draw an equidistant channel with a 50% centre line manually in MT 4.

 

Hi all

Thanks for KOMPOSTER's help, it all worked out, but I need it again. Can you please tell me how to combine these 2 conditions into one, this

if ((StochK_0<StochD_1) && StochD_1 > 80) and if(cci_0 < cci_1 && cci_0 > 100).
 
KoZaNOStra >> :

Hi all

Thanks for KOMPOSTER's help, it all worked out, but I need it again. Please tell me how to combine these 2 conditions into one, this

if ((StochK_0<StochD_1) && StochD_1 > 80) and this if(cci_0 < cci_1 && cci_0 > 100), I want to combine them simultaneously

What's the problem here?


if ( (StochK_0<StochD_1) && (StochD_1 > 80) ) && ( (cci_0 < cci_1) && (cci_0 > 100) )


Or maybe I've got it wrong? :)

 
TheXpert >> :

There are many ways.

For example, form a string in a separate variable, and use the object only for output, but not for storing the previous value.

OK.

but what is the line break signified?

(enter shorter)).

 
luka >> :

>>))

>> I'll make you an example.

 
luka >> :

What's the problem here?


if ( (StochK_0<StochD_1) && (StochD_1 > 80) ) && ( (cci_0 < cci_1) && (cci_0 > 100) )


Or did I misunderstand something? :)


but it says surprise sign, or is it because it's incomplete? OK, I'll finish it and then we'll see...

thank you)))

 
TheXpert >> :

I'll show you an example.

//+------------------------------------------------------------------+
//|                                                 Running line.mq4 |
//|                                       Copyright © 2009, TheXpert |
//|                                           theforexpert@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, TheXpert"
#property link      "theforexpert@gmail.com"

#define NAME "RunningLabel"

string s = "      -== Running line ==-    ";
int width;

string current;
int counter;

void init()
{
   width = StringLen( s);
   current = "";
   counter = 1;
}

int start()
{

   if (-1 == ObjectFind( NAME))
   {
      if (!ObjectCreate( NAME, OBJ_LABEL, 0, 0, 0)) Print ("Not created");
   }

   ObjectSet( NAME, OBJPROP_XDISTANCE, 200);
   ObjectSet( NAME, OBJPROP_YDISTANCE, 20);

   current = StringSubstr( s, counter) + StringSubstr( s, 0, counter);
   counter++;
   
   if ( counter > width) counter = 1;
   
   if (!ObjectSetText( NAME, current)) Print("Not set, ", GetLastError());
}

Make this code an EA and put it on the instrument with the highest number of ticks per time unit.

_________________

The string translation is "\n".

 
luka >> :

>> what's the problem here?

if ( (StochK_0<StochD_1) && (StochD_1 > 80) ) && ( (cci_0 < cci_1) && (cci_0 > 100) )

Sorry to barge in, I'll share a lamer's way of conveniently recording multiple conditions. It's easy to add/remove without worrying about brackets, and everything is clear.

if (true
    && StochK_0<StochD_1
    && StochD_1 > 80 
    && cci_0 < cci_1    
    && cci_0 > 100 
    //&& .... а это я пока убрал     
   )