Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1224

 
Hello! How can I contact Damir?
 
VIX XIV:
Afternoon, is it possible to set a condition in OnTimer? Is it possible to compare Time[0] TimeCorrect?

why do you need OnTimer?

As long as there are no ticks a new bar will not open. Even if the timer expired a long time ago. That is, a tick has come - check for bar opening. ALL

Timers are for other things.

 
karlygash160968:
Hello! How do I contact Damir?

Shall I send you some rope?

 
Maxim Kuznetsov:

why do you need OnTimer?

As long as there are no ticks a new bar will not open. Even if the timer expired a long time ago. That is, a tick has come - check for bar opening. ALL

The timers are for something else.

So, are you saying that it's better to put ontick and put a time limit(Time[0])?

 
karlygash160968:
Hello! How can I contact Damir?

The Damir I knew left us twenty-five years ago. You go to the sorcerers...

 
Artyom Trishkin:

The Damir I knew left us twenty-five years ago. You go to the sorcerers...

What was the answer?
 
karlygash160968:
What was the answer?

I don't know the other Damir - that's the answer. It's exactly the same as your question. Ask those who know other Damirs - maybe they will give you their phone numbers...

ZS. Don't be rude to forum participants - it's indecent. Especially as Alexey suggested tying up with a rope, not hanging oneself with it.

However, everyone has his own world, with his own associations, subject to his own desires.

 
Somebody answer me.)
 
Yevhenii Levchenko:

Salud!
There is a code that translates a stop to Breakeven (for sales, for example):

If the stop definition line is at the open price level as follows:

then ok, it transfers the stop without any problems.

But how do I add here so it's not at the open price, but below:

or:

Then immediately problems fly out. Says, they are wrong stops:

Although you can move the hands and below the stop. Please advise how to solve this case?

When you move sl/tp, you should take into account the value of the minimum indentation of these levels from the price (StopLevel).

For the current symbol:

int stoplevel=(int)SymbolInfoInteger(Symbol(),SYMBOL_TRADE_STOPS_LEVEL);

I.e., the stoploss setting level must not be closer to the price than the specified value. If the value is zero, this does not mean there is no stop level. It indicates that the value is floating and a minimum of two spread values should be used. This is for forex. For exchange - check with your broker to see how their server is set up.

 
Yevhenii Levchenko:
Somebody answer me)

Look carefully at the tool data sheet.

Reason: