[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 612

 
Fox_RM:

It turned out to be not so simple. I added a number to the name, 3 (for example) lines are created, but they don't move anywhere:( It turns out that I have to do a closed loop and assign a new number each time, but here the situation is identical with assigning

time line name. It's just awful...


Look at this indicator
Files:
_linestat.mq4  6 kb
 
alsu:
indicate at the beginning of the programme
Thank you very much.
 
void flatline(string labebe,datetime time1,double price1,datetime time2,double price2,color colir, int W)
  {
     ObjectCreate(labebe, OBJ_TREND, 0,time1,price1,time2,price2);
   ObjectSet(labebe, OBJPROP_COLOR, colir);
   ObjectSet(labebe, OBJPROP_STYLE,0);
   ObjectSet(labebe, OBJPROP_RAY,0);
   ObjectSet(labebe, OBJPROP_WIDTH,W);   
   ObjectSet(labebe, OBJPROP_BACK, true);
   }
Function code for drawing lines. Thank you so much to everyone who responded.
 

Guys help,

The issue is this, there is a self-made graphical indicator, but the problem is the following, when a certain point comes, let us say the current time

if ((k>=15 && k<16) || (Hour()>=15)) // где k- по прошлым дням (для рисования не только в одном дне, но и по всей истоии)

It should draw an extremum at an old trading session (it's convenient to determine where the trade is now), but the catch is that the indicator doesn't draw the chart, only if you switch timeframe back and forth ...

Here is a piece of drawing code

if (Close[iHighest(NULL,0,MODE_CLOSE,8*p_t,i-15*p_t)]> Open[iHighest(NULL,0,MODE_OPEN,8*p_t,i-15*p_t)])
{

max_eu=Close[iHighest(NULL,0,MODE_CLOSE,8*p_t,i-15*p_t)];
Name="max2";
ObjectCreate(Name,OBJ_TREND,0,Time[iHighest(NULL,0,MODE_OPEN,8*p_t,i-15*p_t)],max_eu,Time[i]+l,max_eu);
ObjectSet(Name, OBJPROP_COLOR, Navy);
ObjectSet(Name,OBJPROP_RAY,false);
ObjectSet(Name, OBJPROP_TIMEFRAMES, OBJ_PERIOD_H1 | OBJ_PERIOD_M30| OBJ_PERIOD_M15 | OBJ_PERIOD_M5);
ObjectSet(Name, OBJPROP_WIDTH, 1);

Label="надпись2";
ObjectCreate(Label,OBJ_TEXT,0,Time[i]+l,max_eu);
ObjectSetText(Label,"Max Европа ", 8, "Arial", Navy);
ObjectSet(Label, OBJPROP_TIMEFRAMES, OBJ_PERIOD_H1 | OBJ_PERIOD_M30| OBJ_PERIOD_M15 | OBJ_PERIOD_M5);

WindowRedraw();
}

I'm confused...

 

DOCTORS:

homemade

it's right


I'm confused...

To untangle, you can put Print( ) after if(...) and see if the condition even includes
 
alsu:
it's the right thing to do


To unravel, you can put Print() after if(...) and see if the condition is even included
There are several conditions there... This is one of the options. I'll put print...
 

Tell me if there are similar programmes to collect statistics?

}
 
Fox_RM:
Function code for drawing lines. Thank you so much to everyone who responded.
void flatline(string nm,datetime t1,double p1,datetime t2,double p2,color clr, int W){
   ObjectDelete(nm);// это не обязательно.
   ObjectCreate(nm, OBJ_TREND, 0,0,0,0,0);
   ObjectSet(nm, OBJPROP_PRICE1,p1);
   ObjectSet(nm, OBJPROP_TIME1,t1);
   ObjectSet(nm, OBJPROP_PRICE2,p2);
   ObjectSet(nm, OBJPROP_TIME2,t2);
   ObjectSet(nm, OBJPROP_COLOR, clr);
   ObjectSet(nm, OBJPROP_STYLE,0);
   ObjectSet(nm, OBJPROP_RAY,false);
   ObjectSet(nm, OBJPROP_WIDTH,W);   
   ObjectSet(nm, OBJPROP_BACK, true);
   WindowRedraw();// если обновлять на каждом тике, лучше поставить в самом конце старта
   return;   
}
 

Alert ("number of bull bars = ", vverh, " - ", vverh/(Konec/100), " % " );


Can you tell me why I get an integer without a comma in vverh/(Konec/100) expression? After the decimal point, the digits should be up to the 4th digit, but it just comes out as an integer. =(

Alert ("number of zero bars = ", nul, " - ", DoubleToStr(nul/(Konec/100),2), " % " ); this expression does not work too.

 
ChAnton:

Alert ("number of bull bars = ", vverh, " - ", vverh/(Konec/100), " % " );


Can you tell me why I get an integer without a comma in vverh/(Konec/100) expression? There should be digits after the decimal point up to the 4th digit, but it just comes out as an integer. =(

hiding somewhere