Questions from a "dummy" - page 265

 
DC2008:

Check out my version:

On a laptop - everything flies!

Check it out. Thank you!
 
How do I know that TRADE_RETCODE_MARKET_CLOSED (market is closed) for a specified symbol without sending a trade order to the server?
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Типы торговых операций
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Типы торговых операций
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Типы торговых операций - Документация по MQL5
 
joo:
How do I know that TRADE_RETCODE_MARKET_CLOSED (market is closed) for a specified symbol without sending a trade order to the server?

https://www.mql5.com/ru/docs/marketinformation/symbolinfointeger?
Документация по MQL5: Получение рыночной информации / SymbolInfoInteger
Документация по MQL5: Получение рыночной информации / SymbolInfoInteger
  • www.mql5.com
Получение рыночной информации / SymbolInfoInteger - Документация по MQL5
 
You can get the time of the trading session SymbolInfoSessionTrade
Документация по MQL5: Получение рыночной информации / SymbolInfoSessionQuote
Документация по MQL5: Получение рыночной информации / SymbolInfoSessionQuote
  • www.mql5.com
Получение рыночной информации / SymbolInfoSessionQuote - Документация по MQL5
 

I ordered an Expert Advisor that works on the basis of the positioning of three MAs: if Fast> Medium> Slow, then I buy with double volume to reverse the position. If the ratio is reversed, we sell with a reversal. The Executor has made a model. When testing it, I see that each position reversal is implemented by three reversal deals. Can anyone suggest what the issue is here?

Screenshots from MetaTrader platform

EURUSD, M5, 2013.07.14

Nord Group Investments Inc., MetaTrader 5, Demo

temp_file_screenshot_34063.png

EURUSD, M5, 2013.07.14, Nord Group Investments Inc., MetaTrader 5, Demo


 
puttup:

I ordered an Expert Advisor that works on the basis of the positioning of three MAs: if Fast> Medium> Slow, then I buy with double volume to reverse the position. If the ratio is reversed, we sell with a reversal. The Executor has made a model. When testing it, I see that each position reversal is implemented by three reversal deals. Can someone tell me what the reason is?


sell - price moved in another direction - flip - price returned - flip again

The chart shows the final result, while the real time mode shows a completely different picture

 
lazarev-d-m:

sell - price went the other way - flip - price returned - flip again

you can see the end result on the chart, but in real time it's a completely different picture

...The point is that the relationship between the price and the MA does not directly affect the performance of operations. The correlation of values of moving averages Fast>Average>Slow should be set in the program and recalculated after the next bar is closed. I.e., spread fluctuations of price and even its movement within a bar should not lead to transactions. What could be the fault of the Executor?
 

The EA used to work without errors, decided to run MT5 again today, but now when compiling it writes:

Cannot be used for static allocated array

double UpVal[5];
double DnVal[5];
double ATRVal[5];

int OnInit()
{
  ResetLastError();
//-----
  Envelopes=iEnvelopes(Symbol(),TimeFrame,MAPeriod,0,MAMethod,MAPrice,Deviation);
  if(Envelopes==INVALID_HANDLE) Print("HandleError = ",_LastError);
//-----
  ATR=iATR(Symbol(),TimeFrame,ATRPeriod);
  if(ATR==INVALID_HANDLE) Print("HandleError = ",_LastError);
//-----
  return(0);
}
//+------------------------------------------------------------------+
  CopyBuffer(Envelopes,0,0,3,UpVal);
  ArraySetAsSeries(UpVal,true);
//-----
  CopyBuffer(Envelopes,1,0,3,DnVal);
  ArraySetAsSeries(DnVal,true);
//-----
  CopyBuffer(ATR,0,0,3,ATRVal);
  ArraySetAsSeries(ATRVal,true);
//+------------------------------------------------------------------+

How can I get rid of it? How can I get rid of it?

 
what's the exchange rate of the credits?
 
G001:

The EA used to work without errors, decided to run MT5 again today, but now when compiling it writes:

Cannot be used for static allocated array

How can I get rid of it? Thank you.

Use dynamic arrays or change the size of static arrays:

double UpVal[];
CopyBuffer(Envelopes,0,0,3,UpVal);
//+------------------------------------------------------------------+
double UpVal[3];
CopyBuffer(Envelopes,0,0,3,UpVal);
Документация по MQL5: Основы языка / Типы данных / Объект динамического массива
Документация по MQL5: Основы языка / Типы данных / Объект динамического массива
  • www.mql5.com
Основы языка / Типы данных / Объект динамического массива - Документация по MQL5
Reason: