Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1442

 
Valeriy Yastremskiy #:

It is not clear, the specified TF should be known. The situation should be more detailed.

When copying an array, I don't want to specify the TF forcibly to make the code universal.

 

I get "params=-1" - I do as in the example.

int params=IndicatorParameters(handle,indicator_type,parameters);

And so, the presence of indicators is determined

2023.02.03 15:21:35.289 2008.01.02 09:02:00   Window=0,  indicator #2,   handle=12

In general, I get error 4014 - "System function is not allowed to be called".

2023.02.03 15:33:52.945 2008.01.02 09:03:00   Ошибка получения параметров индикатора:4014
 
macd_handle = iMACD(_Symbol, _Period, 15, 26, 1, PRICE_CLOSE);
It does not work in the tester, in real life it gives:
2023.02.03 17:53:53.481 6343 (EURGBP,M30) Parameters (4):
2023.02.03 17:53:53.481 6343 (EURGBP,M30) parameter 0: type=TYPE_INT, long_value=15, double_value=0,string_value=(null)
2023.02.03 17:53:53.481 6343 (EURGBP,M30) parameter 1: type=TYPE_INT, long_value=26, double_value=0,string_value=(null)
2023.02.03 17:53:53.481 6343 (EURGBP,M30) parameter 2: type=TYPE_INT, long_value=1, double_value=0,string_value=(null)
2023.02.03 17:53:53.481 6343 (EURGBP,M30) parameter 3: type=TYPE_INT, long_value=1, double_value=0,string_value=(null)


_Symbol, _Period are not parameters, so "the specified TF should be known " .

 
trader6_1 #:
It doesn't work in the tester, in real life it gives:
2023.02.03 17:53:53.481 6343 (EURGBP,M30) Parameters (4):
2023.02.03 17:53:53.481 6343 (EURGBP,M30) parameter 0: type=TYPE_INT, long_value=15, double_value=0,string_value=(null)
2023.02.03 17:53:53.481 6343 (EURGBP,M30) parameter 1: type=TYPE_INT, long_value=26, double_value=0,string_value=(null)
2023.02.03 17:53:53.481 6343 (EURGBP,M30) parameter 2: type=TYPE_INT, long_value=1, double_value=0,string_value=(null)
2023.02.03 17:53:53.481 6343 (EURGBP,M30) parameter 3: type=TYPE_INT, long_value=1, double_value=0,string_value=(null)


_Symbol, _Period are not parameters, so "the specified TF should be known " .

Okay, so there is no solution.

 
How to solve the issue with shifting, when drawing a rectangle, I need accurate drawing at a certain price, and it shifts, then up, then down....
 
Nikolay drawing a rectangle, I need accurate drawing at a certain price, and it shifts, then up, then down....

Can you show me - I couldn't reproduce it. There is a correction on the width on the centre of the candle.

 
Aleksey Vyazmikin #:

Can you show me - I couldn't reproduce it. There is a width correction to the centre of the candle.

Thanks, I got it, I just need to draw on an empty place so that there is no correction on the candlestick :)
 
Nikolay #:
Thanks, I got it, I just need to draw on empty space so there is no candle correction :).

You're welcome.

Perhaps in the settings you need to put "0" on the parameter "Magnetisation"


 
Aleksey Vyazmikin #:

You're welcome.

Maybe you should put "0" on the "Magnetisation" parameter in the settings


Right, thanks)
 

I've encountered an unexplained moment. The account is real. The robot sets a pending order and then follows the price. After the price "caught" the pending order, it opens a SELL position with a specified stop loss and take profit. There are no problems up to this point. Then the price moves in the direction I want and by idea it should work on take profit, which is 50 points. But it didn't. Despite the fact that the current price fell below the level of the price at which the position was opened plus the size of the spread, i.e. 50 + 14 pips, the position closed with the size of 36 pips from the opening price. And so it repeats from time to time, from deal to deal. I run the robot on the tester and see that all closed positions have the size of 50 pips, as it should be.

Is there really a constant deviation, and with a size approximately equal to the size of the spread of 14 pips? Something strange, don't you think? Here is the log of one of yesterday's trades.

KE      0       05:36:02.089    Trades  '1000008949': modify #1021600709 sell stop 0.04 EURUSDrfd -> price: 1.07870, sl: 1.07970, tp: 1.07820) done in 8.663 ms
RK      0       05:45:14.097    Trades  '1000008949': deal #1021883094 sell 0.04 EURUSDrfd at 1.07870 done (based on order #1021600709)
RJ      0       07:49:46.015    Network '1000008949': scanning network for access points
PJ      0       07:49:46.873    Network '1000008949': scanning network finished
IR      0       10:51:16.238    Trades  '1000008949': market buy 0.04 EURUSDrfd, close #1021600709 sell 0.04 EURUSDrfd 1.07870
FF      0       10:51:16.258    Trades  '1000008949': accepted market buy 0.04 EURUSDrfd, close #1021600709 sell 0.04 EURUSDrfd 1.07870
JF      0       10:51:16.558    Trades  '1000008949': market buy 0.04 EURUSDrfd, close #1021600709 sell 0.04 EURUSDrfd 1.07870 placed for execution
OI      0       10:51:16.558    Trades  '1000008949': order #1021607738 buy 0.04 / 0.04 EURUSDrfd at market done in 316.213 ms
EF      0       10:51:16.558    Trades  '1000008949': deal #1021888944 buy 0.04 EURUSDrfd at 1.07834 done (based on order #1021607738)

Regards, Vladimir.