Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1559

 
Artyom Trishkin #:
Did you get it by deleting it?

No. I use the global variable as a flag.

It is either zero or equal to the prefix of the panel we are moving.

ZY. I had no questions how to bring an object to the foreground. And deleting and then drawing an object is used for this very purpose. Although it is more correct not to delete, but to hide (imho).

 
Please give me an example of how to get a fractal value in MT5 Expert Advisor.
 

I am testing the Expert Advisor on tick history from broker, mode "based on real ticks", I get errors in the log that some tick data is missing:

question - why didn't mt5 generate the missing ticks in this case, if the help says so?


 

double profit2 = PositionGetDouble(POSITION_PROFIT) at a loss of $200 what will it show?
negative pips or positive?


Hand_RSI=iRSI(my_symbol,rsi_timeframe,rsi_period,rsi_price);

% value or integer?

 

I can't edit that comment, so I'll put it like this


double handle_iRSI=iRSI(NULL,Period(),4,NULL);

Print("handle_iRSI = ",handle_iRSI);

double handle_iMA=iMA(NULL,Period(),50,0,MODE_SMA
,PRICE_CLOSE);
Print("handle_iMA = ",handle_iMA);

}


made a check, on any instrument and tf shows 10-11


2024.08.16 18:01:36.068 test(USDJPY,H1) handle_iRSI = 10.0

2024.08.16 18:01:36.068 test (USDJPY,H1) handle_iMA = 11.0

2024.08.16 18:01:36.701 test (USDJPY,H1) handle_iRSI = 10.0

2024.08.16 18:01:36.701 test (USDJPY,H1) handle_iMA = 11.0

2024.08.16 18:01:37.176 test (USDJPY,H1) handle_iRSI = 10.0

2024.08.16 18:01:37.176 test (USDJPY,H1) handle_iMA = 11.0

2024.08.16 18:01:38.078 test (USDJPY,H1) handle_iRSI = 10.0

2024.08.16 18:01:38.078 test (USDJPY,H1) handle_iMA = 11.0

Waiting - cross entries as in the figure. There is an algorithm, but something is crooked here, as the indicator should be in the range 0-100.

Files:
12b.png  526 kb
 
Mickey Moose PositionGetDouble(POSITION_PROFIT) at a loss of $200 what will it show?
negative value of points or positive?


Hand_RSI=iRSI(my_symbol,rsi_timeframe,rsi_period,rsi_price);

% value or integer?

If we are talking about mt5, then,
1. negative value in the deposit currency.
2. Integer, the value of the indicator handle, but not the indicator value itself.
 
Mickey Moose (USDJPY,H1) handle_iRSI = 10.0

2024.08.16 18:01:36.068 test (USDJPY,H1) handle_iMA = 11.0

2024.08.16 18:01:36.701 test (USDJPY,H1) handle_iRSI = 10.0

2024.08.16 18:01:36.701 test (USDJPY,H1) handle_iMA = 11.0

2024.08.16 18:01:37.176 test (USDJPY,H1) handle_iRSI = 10.0

2024.08.16 18:01:37.176 test (USDJPY,H1) handle_iMA = 11.0

2024.08.16 18:01:38.078 test (USDJPY,H1) handle_iRSI = 10.0

2024.08.16 18:01:38.078 test (USDJPY,H1) handle_iMA = 11.0

Waiting - cross entries as in the figure. There is an algorithm, but something is crooked here, as the indicator should be in the range 0-100.


  hRSI=iRSI(Symbol(), PERIOD_H1, 14, PRICE_CLOSE);
  if(hRSI==-1) 
     return(INIT_FAILED);
  CopyBuffer(hRSI,0,1,1,buf);
  return(buf[0]);

https://www.mql5.com/ru/docs/series/copybuffer

Документация по MQL5: Доступ к таймсериям и индикаторам / CopyBuffer
Документация по MQL5: Доступ к таймсериям и индикаторам / CopyBuffer
  • www.mql5.com
Получает в массив buffer данные указанного буфера указанного индикатора в указанном количестве. Отсчет элементов копируемых данных (индикаторный...
 
Oleg Kubenko #:
Comrades, how to catch the event of closing an order by take profit or stop loss? OnChartEvent does not want to

You need to use OnTradeTransaction

Check the answer submitted by  Vladimir Karputov 

https://www.mql5.com/en/forum/393483

OnTradeTransaction consitently getting called invoked with incorrect values in
OnTradeTransaction consitently getting called invoked with incorrect values in
  • 2022.04.12
  • cdjindia
  • www.mql5.com
Following code always prints Filled Long regardless of whether a Sell order gets filled or buy order gets filled...
 

I still don't understand where to shove this copybuffer if it

hRSI

shoved into the muing handle

 
Mickey Moose #:

I still don't know where I'm supposed to put this copybuffer if

shoved into the muing handle

What do you want to get?

Do you have the code for mt4 to understand what you need?