Errors, bugs, questions - page 896

 

Greetings!

MT5 Optimizer - does CustomMax calculate correctly?

I am running optimizer (genetic optimization) in MT5 5.00 build 722 and accidentally noticed that the optimization results are calculated in an unexpected way.

The Expert Advisor returns OnTester():

Profit * Trades * (1/(MaxEquityDDPercent+1)) * RecoveryFactor

Where:

   double Profit = TesterStatistics(STAT_PROFIT);

   double Trades = TesterStatistics(STAT_TRADES);

   double MaxEquityDDPercent = TesterStatistics(STAT_EQUITY_DDREL_PERCENT);

   double RecoveryFactor = MathAbs(TesterStatistics(STAT_RECOVERY_FACTOR));

It was expected that with smaller profit and recovery factor the result would be smaller, but it is not - see the screenshot.


Is it something I do not understand correctly?

 
MetaDriver:

Well, let's move it:

But I'm afraid you won't like it. I, for example, don't like it - the chart twitches and doubles. And I wanted to do better - move it smoothly to the right place...

// What's interesting, it works twice as fast with ChartRedraw() than without it. At the same time, it jerks more.

There is still a problem with ChartNavigate(). Will it be fixed someday? Or is it not considered a bug?

Is there already a post on this topic in Service Desk? Or to add more? ))

 

Execution error: Stack overflow

class A {
        static  bool OrderSend( const MqlTradeRequest& request, MqlTradeResult& result, bool async_mode = false )
	void function();
};
void A::function()
{...
	OrderSend(...) // ошибка выполнения возникает здесь
	A::OrderSend(...) // не помогает
...}

If we replace OrderSend with any other name - everything is fine

presence of static does not affect the error

calling A::OrderSend()- the error is unaffected

 
A100:

Stack overflow execution error

If you replace OrderSend with any other name, it's fine


because the context must be resolved

::OrderSend

 

I think I am not calling ::OrderSend, but A::OrderSend()

should work

 
A100:

I think I'm not calling ::OrderSend, but A::OrderSend()

which line are you thinking about?

that you have just

void A::function()
{...
	OrderSend(...) // ошибка выполнения возникает здесь
вызывается именно ваша A::OrderSend
If you want to call terminal, do :: before Ordersend
 
Thank you, I've found the reason - I'm withdrawing the question - I've locked it myself
 
A100:
Thank you, I found the reason - I remove the question - I looped it myself

I understand that you called yourself in your Ordersend without ::

I got caught in it at once, when I redefined Print and Comment in the class. now I do it all the time :)

 
sergeev:

I understand you called yourself in your Ordersend without ::

Well, yes, although A::OrderSend has 3(three) parameters, butthe latter is the default and the compiler could not (and should not) distinguish from ::OrderSend by the number of parameters
 
Can you tell me how to create a poll on the forum?
Reason: