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

 

orb, how do you get the time val? In order to have one coordinate for the trend line, i.e. price and time.

  double val;
  // расчет максимального значения цены на 20 последовательных барах
  // с индекса 4 по индекс 23 включительно на текущем графике
  val=High[iHighest(NULL,0,MODE_HIGH,20,4)];
 
RoboT1:

orb, how do you get the time val? In order to have one coordinate for the trend line, i.e. price and time.

  int bar = iHighest(NULL,0,MODE_HIGH,20,4);
  datetime time = Time[bar];
  double val = High[bar];
 
Sorry, what is the compiler swearing about? Where to look? '(' - function definition unexpected C:\Demo count å åùå¨expertsètal bì.mq4 (92, 14)
 
Dimka-novitsek:
Sorry, what is the compiler swearing about? Where to look? '(' - function definition unexpected C:\Demo counts å åùå¨expertsètal bì.mq4 (92, 14)

Click on this very inscription with your mouse and it will move the cursor where you want to look.
 

On the function, but I didn't touch it, it compiled before!!!

I added five or seven lines of calculations inside the start.

void Otkroem_order (int vv)

 
Dimka-novitsek:

On the function, but I didn't touch it, it compiled before!!!

I added five or seven lines of calculations inside the start.

Your question has been answered. No one else but you cares what you touch there and what you don't, what compiled and what didn't - that's your own personal problem.
 

Yes, of course, I'm just surprised, the function itself has compiled before. It's below the start, by itself.

No, really, the body of the function compiled separately, a number of lines that I finished compiled separately too, but together, karaul, 12 errors...

All right, I'll take it apart, I'll figure it out. Oh, I drank some tea, there was an extra parenthesis, and the compiler kept nodding at the function...

 
TheXpert:




Thank you. That's just what I need.
 
ObjectCreate("LinePurple", OBJ_VLINE, 0, Time[10], 0);
ObjectSet("LinePurple", OBJPROP_COLOR, Purple); 
ObjectSet("LinePurple", OBJPROP_WIDTH, 2);
ObjectSet("LinePurple", OBJPROP_STYLE, STYLE_SOLID);

double timePurple=ObjectGet("LinePurple", OBJPROP_TIME1);
How do I convert the vertical timePurple line (in seconds from 1970) to bars (from 0 bar to the left)? So that the time in bars can be used where the code requires it.
 
Please give me a function to calculate the maximum permissible opening lot on the deposit, taking into account the open positions (equity). Thank you in advance.
Reason: