Hello,
I'm facing an issue with my EA. It's working for months, but since today the VPS Brazil Metaquotes server is deleting and showing this message:
The following is my code:
Perhaps there is a problem on the server - but you yourself are grossly breaking the rules: THE INDICATOR HANDLE in MQL5 MUST BE CREATED ONCE! THIS SHOULD BE DONE IN OnInit ()!
Perhaps there is a problem on the server - but you yourself are grossly breaking the rules: THE INDICATOR HANDLE in MQL5 MUST BE CREATED ONCE! THIS SHOULD BE DONE IN OnInit ()!
Usually I use in OnInit().
But, this particular indicator should have a variable PERIOD according of other rules.
Is it possible to make it in diferent way instead of created in OnTick() ?
Usually I use in OnInit().
But, this particular indicator should have a variable PERIOD according of other rules.
Is it possible to make it in diferent way instead of created in OnTick() ?
You just create all the handles in OnInit () in advance and put them into an array.
Example:
Example MultiTimeFrame iRSI get value
- 2020.07.05
- www.mql5.com
You just create all the handles in OnInit () in advance and put them into an array.
Example:
Example MultiTimeFrame iRSI get value
Ok. I will read about it.
Thank you!
You just create all the handles in OnInit () in advance and put them into an array.
Example:
Example MultiTimeFrame iRSI get value
You did not show your code - You did not show your code and the lines in which the error occurs.
You did not show your code - You did not show your code and the lines in which the error occurs.
It does't make sense. This code is working for months.
But the following is the part that having some problem.
I insert a comment in the line with problem in VPS.
int ATR_SL,ATR_V_; double atr_sl; double atr_v_; int shift_=0;
//+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { Trade.SetTypeFilling(OrderFillingType); ATR_SL=iATR(Symbol(),PERIOD_D1,SL_TimeFrame_Period); ATR_V_=iATR(Symbol(),ATR_TIMEFRAME,21); }
void OnTick() { atr_v_=ATR(ATR_V_,shift_); atr_sl = ATR(ATR_SL,0); }
//+------------------------------------------------------------------+ double ATR(int handle,int shift) { double _atr[]; CopyBuffer(handle,0,shift,1,_atr); //Line with problem in VPS return _atr[0]; } //+------------------------------------------------------------------+
It does't make sense. This code is working for months.
But the following is the part that having some problem.
I insert a comment in the line with problem in VPS.
Please show me the minimal code - code that I can compile and test.
Please show me the minimal code - code that I can compile and test.
It's clearly a VPS issue, because I updated my MT5 (2571), compiled again with the new version and it's working at my PC.
But when I send to VPS (BRAZIL), it stop work after some minutes.
I can allow you access my PC using TeamViewer.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I'm facing an issue with my EA. It's working for months, but since today the VPS Brazil Metaquotes server is deleting and showing this message:
The following is my code: