How to report a bug with MT5? - page 2

 
bot #:

@Alain Verleyen is it possible to add this to the list of bugs for the Dev team to look into please? Steps and sample code to reproduce it in my messages above.

Thanks

Asked on Russian forum.

 
Alain Verleyen #:

Asked on Russian forum.

@Alain Verleyen Thank you. Please let me know once you hear from the Dev team. Thanks
 
r2d2 #:
@Alain Verleyen Thank you. Please let me know once you hear from the Dev team. Thanks

Late reply, but because .Net Framework 4.8 is supported, so are .Net Standard 2.0 libraries.

Admittedly you're missing out on the newer C# language features, and a lot of CLR enhancements, but you can achieve anything you need to with .Net Standard 2.0, and most NuGet packages provide a version which will target this.

 

Dear all,

I think I have found a bug in MQL5, but would first like to confirm it by the moderators. I am not sure if I am posting the bug on the correct place, if not sorry, please move it.
It's about the iTEMA indicator, here's the excerpt of the code:

//Global variables
int      MA_handle    = INVALID_HANDLE;
int      TEMA_handle  = INVALID_HANDLE;

double   MA_buf[];
double   TEMA_buf[];

int OnInit()
{
//
//...
//
MA_handle = iMA(_Symbol, PERIOD_CURRENT, MA_period, MA_shift, MA_method, MA_price);
if(MA_handle < 0) return(false);
ArraySetAsSeries(MA_buf,true);

TEMA_handle = iTEMA(Symbol, PERIOD_CURRENT, TEMA_period, TEMA_shift, TEMA_price);
if(TEMA_handle < 0) return(false);
ArraySetAsSeries(TEMA_buf,true);
}

void OnDeinit(const int reason)
{
//
//...
//
IndicatorRelease(MA_handle);
IndicatorRelease(TEMA_handle);
ArrayFree(MA_buf);
ArrayFree(TEMA_buf);
}

void OnTick()
{
//
//...
//

if(CopyBuffer(MA_handle,0,0,3,MA_buf)       <= 0)    PrintFormat("Moving Average Indicator Error %d",GetLastError());
if(CopyBuffer(TEMA_handle,0,0,3,TEMA_buf)   <= 0)    PrintFormat("Triple Exponential Moving Average Indicator Error %d",GetLastError()); 

//
//...
//

//Long signal:
bool signal_Long = true;
      
if(TEMA_buf[1] > MA_buf[1] && TEMA_buf[2] < MA_buf[2])     signal_Long = true;          // This is how it should be
//if(TEMA_buf[2] > MA_buf[1] && TEMA_buf[1] < MA_buf[2])   signal_Long = true;          // This is working correctly
else                                                       signal_Long = false;

//
//...
//

//Short signal:
bool signal_Short = true;

if(TEMA_buf[1] < MA_buf[1] && TEMA_buf[2] > MA_buf[2]) signal_Short = true;             // This is how it should be
//if(TEMA_buf[2] < MA_buf[1] && TEMA_buf[1] > MA_buf[2]) signal_Short = true;           // This is working correctly
else                                                   signal_Short = false;
In other words:
The iTEMA indicator / buffer mixes the candle positions - instead of [1] which should the last candle like in iMA, [2] is the last candle within iTEMA. On the other hand, [2] is the last candle in iTEMA, but it should be the penultimate candle.

Thanks in advance for your feedback.
 
EA_Trader1 #:

Dear all,

I think I have found a bug in MQL5, but would first like to confirm it by the moderators. I am not sure if I am posting the bug on the correct place, if not sorry, please move it.
It's about the iTEMA indicator, here's the excerpt of the code:

In other words:
The iTEMA indicator / buffer mixes the candle positions - instead of [1] which should the last candle like in iMA, [2] is the last candle within iTEMA. On the other hand, [2] is the last candle in iTEMA, but it should be the penultimate candle.

Thanks in advance for your feedback.

Please prove your claims with log output showing the values and a chart screenshot showing them on the chart.

99.9% chance it's not a bug but your error or misunderstanding.

 

Dear Alain,

sorry for my late feedback.
Enclosed you can find the MA and TEMA values on a specific example:


TEMA:


MA:

And here the cross:

Cross:


Note that the signal was defined as follows:

  • If TEMA[1] > MA[1] and TEMA[2] < MA[2] ---> Buy-Signal (TEMA crosses MA from below)
  • If TEMA[1] < MA[1] and TEMA[2] > MA[2] ---> Sell-Signal (TEMA crosses MA from above)

According to this function and for this specific example, that would be a sell signal. However, in MQL5 it's a buy signal. And that's what I think is a bug.

Thanks in advance for your feedback.
 

Your image is pretty unclear. Please either print as log or as comment all relevant prices of the signal being triggered and show them.

Or learn to use the debugger:

Code debugging:  https://www.metatrader5.com/en/metaeditor/help/development/debug
Error Handling and Logging in MQL5:  https://www.mql5.com/en/articles/2041
Tracing, Debugging and Structural Analysis of Source Code, scroll down to: "Launching and Debuggin": https://www.mql5.com/en/articles/272

Code debugging - Developing programs - MetaEditor Help
  • www.metatrader5.com
MetaEditor has a built-in debugger allowing you to check a program execution step by step (by individual functions). Place breakpoints in the code...
 

Hi Carl,

ok sorry, below you can find the log of this specific example:

Log-File


As you can see, this would have been a sell signal, but a market buy position is opened. And of course, I am opening a buy position when there is a long signal and vice versa.

 
EA_Trader1 #:

Hi Carl,

ok sorry, below you can find the log of this specific example:


As you can see, this would have been a sell signal, but a market buy position is opened. And of course, I am opening a buy position when there is a long signal and vice versa.

So it's a clearly a bug...in your code.

Show all the relevant code.

 
Hi Alain,

it's not a bug in my code. Please see the code above (https://www.mql5.com/en/forum/388557/page2#comment_47956842) - everything is described there.

If signal_Long = true, a market buy position is opened.
If signal_Short = true, a market sell position is opened.

Thanks!
How to report a bug with MT5?
How to report a bug with MT5?
  • 2022.02.10
  • www.mql5.com
I would like to know general process for reporting a bug with MT5. I have created a dotnet6.0 C# DLL...