Questions from Beginners MQL5 MT5 MetaTrader 5 - page 513

 
Aleksey Vakhrushev:
Oksana, no, I just check the condition(i.e. i prescribed the indicator parameters completely without them to see if there is a difference)

Maybe you are counting the candles wrong then? Maybe it is true that on a 1439 or 1140 or 1441 candlestick the parameter is 0, and, for example, on a 1445 candlestick it will already have a value? (I just had a quick look at the indicator itself)

The value should be only on the candle on which the break occurred. I advise to use a cycle. The value may not be on the 1440th candle. You have to look forward and backward from it.

 
Oksana Berenko:

Maybe you are counting the candles wrong then? Maybe it is true that on a 1439 or 1140 or 1441 candlestick the parameter is 0, and, for example, on a 1445 candlestick it will already have a value? (I just took a quick look at the indicator itself)

The value should be only on the candlestick on which the break occurred. I advise you to use a cycle. The value may not be on the 1440th candle. It is necessary to look forward and backward from it.

I tried it with the standard zigzag, 1440 bar does not work either, but 288 seems to be ok
 

Good afternoon,

I messed up the code somewhere and as a result it doesn't do exactly what I need it to do. How can I unload the code step by step to see what I've missed?

 
kashi_ann:

Good afternoon,

I messed up the code somewhere and as a result it doesn't do exactly what I need it to do. How can I unload the code step by step to see what I've missed?

Program Development: Debugging - MetaEditor
 

Yes, I use it all. I would like to see the result of, say, 10-20 runs, in one table. Is that possible?

For example on a 15 min chart:

9:00 a.m. is the data.

9-15- the following

9-30- the following and so on.

The logic is as follows:

We open 2 multidirectional pending orders (2,3). One of them triggers (2) and the other one (3) is deleted.

When the first one (2) is also closed (by order 4), we check if there are any orders/positions. If not, the loop is repeated.

It seems to be not very complicated.

I obtained it by debugging no open orders and positions. And the next step in this situation is to set 2 new pending orders (5,6) and the result is that only one (5) is set.

At the same time, when the debugger writes no orders/positions, the chart displays lines for some order/position without a number.

Then proceeds to the lines of placing orders, nothing happens, although on the first round the orders were immediately placed in the trade.

Reaches the end of the code, returns to the beginning, the data is updated, the order that was visible earlier is erased from the chart, and one new order (5) appears.

What have I not taken into account?

Maybe we should wait for one bar...and then the cycle repeats...

 
kashi_ann:

Yes, I use it all. I would like to see the result of, say, 10-20 runs, in one table. Is that possible?

For example on a 15 min chart:

9:00 is the data.

9-15- the following

9-30- the following and so on.

The functions

Comment();
Alert();
Print();
PrintFormat();

to help you

 
kashi_ann:

Yes, I use it all. I would like to see the result of, say, 10-20 runs, in one table. Is that possible?

...

I can't figure out what you want to see?
 
Karputov Vladimir:
Can't figure out what you want to see?

As a matter of fact, there's nothing concrete.

I am faced with a problem that I don't know how to solve.

Previous experience tells me that I have overlooked something.

I am not able to trace my error by means of debugging.

And I don't really understand how the program processes the code, so I want to see the whole sequence to see the whole picture.

If there is another way, glad to hear about it.

 
kashi_ann:

As a matter of fact, there's nothing concrete.

I am faced with a problem that I don't know how to solve.

Previous experience tells me that I have overlooked something.

I am not able to trace my error by means of debugging.

And I don't really understand how the program processes the code, so I want to see the whole sequence to see the whole picture.

If there is another way, glad to listen.

Again, no specifics. OK: finger in the sky -DebugBreak.

To apply it roughly like this:

//---
   if(PositionSelect(Symbol()))
     {
      //--- если успешно выбрали позицию по символу
      DebugBreak(); // программная остановка отладки
     }
 
Hello, Could you please tell me the code which will cause the EA to execute some action at the beginning of a new day, i.e. 00.00, or in other words how to display the condition "If it is a new day (00.00)" in MQL?
Reason: