Drawing a square or rectangle. Really need help... - page 3

 

I didn't see the stupidity in your questions. They are ordinary questions from a person who wants to know something.

They become silly when they contain the hidden text "you better write for me and I'll just use it without understanding what's going on". And you deleted them after my answer.

 

Can you tell me please? Why is only the dona line drawn in this case too?

  double point = _Digits%2 == 0 ? _Point : _Point*10;

  datetime dt = ChartTimeOnDropped();

  TimeToStruct(ChartTimeOnDropped(), mqlDateTime);

  if(CopyRates(_Symbol, PERIOD_D1, dt, 1, mqlRates) < 0)

  Print("");

  

  //--- Имена линий ---    

  string objName_H = TimeToString(mqlRates[0].time, TIME_DATE);

  string objName_L = TimeToString(mqlRates[0].time, TIME_DATE);


 

  //--- Строим саму линию по Хай      

  ObjectCreate    (0, objName_H, OBJ_TREND, 0, mqlRates[0].time, mqlRates[0].high, mqlRates[0].time+PeriodSeconds(PERIOD_D1), mqlRates[0].high);

  ObjectSetInteger(0, objName_H, OBJPROP_RAY_RIGHT, false);

   

  //--- Строим саму линию Лоу     

  ObjectCreate    (0, objName_L, OBJ_TREND, 0, mqlRates[0].time, mqlRates[0].low, mqlRates[0].time+PeriodSeconds(PERIOD_D1), mqlRates[0].low);

  ObjectSetInteger(0, objName_L, OBJPROP_RAY_RIGHT, false);


 
AlexeyVik:

I didn't see the stupidity in your questions. They are ordinary questions from a person who wants to know something.

They become silly when they contain the hidden text "you better write for me and I'll just use it without understanding what's going on". And you deleted them after my answer.

I get it. Thank you.
 
Alex_Profit:

Can you tell me please. Why is only dona line drawn in this case too?

You only have different variable names, but their values as well as the line names are the same.

  //--- Имена линий ---    

  string objName_H = TimeToString(mqlRates[0].time, TIME_DATE+"_H");

  string objName_L = TimeToString(mqlRates[0].time, TIME_DATE+"_L");

That way it will be different.

 

The compiler complains about implicit conversion from 'string' to 'number'.

and nothing is displayed at all.


 
Alex_Profit:

The compiler complains about implicit conversion from 'string' to 'number'.

and nothing is displayed at all.

Now only the top line is displayed, with the same warning, somehow it doesn't work correctly. Why does this happen?
 

You should drink less...

That's right.

  //--- Имена линий ---    

  string objName_H = TimeToString(mqlRates[0].time, TIME_DATE)+"_H";

  string objName_L = TimeToString(mqlRates[0].time, TIME_DATE)+"_L";

 
And you need to think more...
 

It's better to go like this at all

  string objName = TimeToString(mqlRates[0].time, TIME_DATE);

  //--- Строим саму линию по Хай      

  ObjectCreate    (0, objName+"_H", OBJ_TREND, 0, mqlRates[0].time, mqlRates[0].high, mqlRates[0].time+PeriodSeconds(PERIOD_D1), mqlRates[0].high);

  ObjectSetInteger(0, objName+"_H", OBJPROP_RAY_RIGHT, false);

   

  //--- Строим саму линию Лоу     

  ObjectCreate    (0, objName+"_L", OBJ_TREND, 0, mqlRates[0].time, mqlRates[0].low, mqlRates[0].time+PeriodSeconds(PERIOD_D1), mqlRates[0].low);

  ObjectSetInteger(0, objName+"_L", OBJPROP_RAY_RIGHT, false);

 

It turns out that when an object is created, the value "_H", _L", is attributed.

Well, you have to think about it, I agree. And I don't drink much.

I think it'll get better with time. Thank you.

objName+"_H",

objName+"_L",