Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 964

 
Nikolai Semko:
I don't understand why there is so much hype around the tester. I only need it for a single pass. All optimisation should take place within the program.
The last time a tester was used for shenanigans was about 7-8 years ago.

Well sort of disagree, I've now finished the automatic search for MM for any TS, alas, MM rules any way, I need an intraday TS, and to find a MM that is more than 5% drawdown for a test year or two just by looking at the graph - well, not realistic (TS with stoplosses! )

now if i have automatic search for MM, different TS will be tested - it's already easier... waiting a long time, MM will search by random entries for 49 hours per year, but i won't count it by hand, i will put my notebook tomorrow, let it pant

i just dropped the test, it's time to go home, here's a 5% drawdown with random entries, to be honest i don't even know what is the optimal MM here - 10 groups, in each group an order will either be started by an MM strategy or it will be moved to the other side, and maybe this order will be reduced in lots or increased, all settings are reasonable, max lot 0.5, min 0.1

 
Igor Makanu:

Well as if I do not agree, I have now finished the automatic search for MM for any TS, alas, MM rules any way, I need an intraday TS, and to find a MM that is more than 5% drawdown for a test year or two just by looking at the chart - well, not realistic (TS with stoplosses! )

now if i have automatic search for MM, different TS will be tested - it's already easier... waiting a long time, MM will search by random entries for 49 hours per year, but i won't count it by hand, i will put my notebook tomorrow, let it pant

i even do not know which MM is optimal here - 10 groups, in each group an order will either be started by an MM strategy or it will be shifted to another side and maybe this order will be decreased in lots or increased, all settings are reasonable, max lot 0.5, min 0.1


What is MM? Machine something?
But this picture is the result of optimization(adjustment) of parameters according to historical data. And the available result is based on the same historical data. There is no magic, just a hocus-pocus. You do not think that this result will be repeated at the next interval of future data, do you?
Well, you cannot go forward on a mountainous terrain with precipices, looking only in the rear-view mirror.
Igor, I suggest switching to you.


 
Nikolai Semko:
What is MM? Machine something?

MM is the same as PUK. Money management rules.:))))

 
Pul-Adgi Mo-UlStan:

I've already spent a whole day transferring the ready code of the owl and indicator from mt4 to mt5 It's crazy i would have already written 2 advisors from scratch on mt4 with different algorithms....

psc. bear with me, shhhhh. ok this is only because i need a quick test of mt5...

Too bad there is no converter.....

I take it tumblr's offer was rejected due to disclosure of strategy?

 
Nikolai Semko:
And what is MM? What is MM?
But this picture is the result of optimising the parameters to the historical data. And the available result is based on the same historical data. There is no magic, just hocus-pocus. You do not think that this result will be repeated on the next section of future data, do you?
It is impossible to go forward on a mountainous terrain with precipices, looking only in rear-view mirrors.
Igor, I suggest changing to you.


Money Management

It's not exactly optimization, the goals have not been reached yet, the pending orders by random entries follow the price, in the optimizer the selection is performed according to the formula y=kx+b, later I will use polynomial and exponent but the optimizer searches only for the factors and the order values, so not to fog it up - it is a grid, well, almost, but the goals have not been reached yet

When I look at the markets I have been dealing with them (though not very actively) since I registered at the Forum, the programming layer in MQL has taken a lot of time, but in general the idea has been developed through the year of related writing of Expert Advisors based on the requests of the working people )))

no problem, go ahead

 
Nikolai Semko:

Have you tried using macro substitutions at the beginning of the program?
for example:

You don't have to change anything.
The truth is, having worked in MQL5 for quite a long time, MQL4 will annoy you. I know how it is.

I did this, thank you it works)))

#define  Ask_ SymbolInfoDouble(_Symbol,SYMBOL_ASK)
#define  Bid_ SymbolInfoDouble(_Symbol,SYMBOL_BID)
#define  Point_ SymbolInfoDouble(_Symbol,SYMBOL_POINT)
 

There was a function

OrderCloseTime

In µl5 it is replaced by))))

      //--- select history for access
      HistorySelect(0,TimeCurrent());
      //---
      int    orders=HistoryDealsTotal();  // total history deals

      for(int i=orders-1;i>=0;i--)
        {
         ulong ticket=HistoryDealGetTicket(i);
         if(ticket==0){Print("HistoryDealGetTicket failed, no trade history"); break;}
         //--- check symbol
         if(HistoryDealGetString(ticket,DEAL_SYMBOL)!=_Symbol) continue;
         //--- check Expert Magic number
         if(HistoryDealGetInteger(ticket,DEAL_MAGIC)!=(MA_MAGIC1||MA_MAGIC2)) continue;
         //--- check 
         datetime timCloseOrder=?????????????????????
         ГДЕ ВРЕМЯ ЗАКРЫТИЯ ОРДЕРА ВЗЯТЬ???????? 

I'm losing my mind for the third day, I've gone through all the pitfalls, I'm testing the time limit, I can't figure out how to do it, at least write where they putOrderCloseTime()----)))))))))))))))

 
Pul-Adgi Mo-UlStan:

There was a function

In µl5 it is replaced by))))

I'm going crazy the third day I've gone through all the pitfalls, all tested the time limit I can't figure out how to do it, at least write where did OrderCloseTime()----)))))))))))))))

Yes, to find the time to close a position is a nightmare...

In mql5 there is no such function a priori, because the order "life" here ends when the deal is created. And in general, we have divided what we used to call an order in mql4 into 3 stages Order - Deal - Position. For obtaining the date and time of closing of a position, we need to select the history of the required position and look through all deals of it, checking the type of entry. You need DEAL_ENTRY_OUT - partial or complete exit from the position, and DEAL_ENTRY_IN_OUT -reversal of the position. Then by checking the date and time of such a trade you will be able to find out when the position was closed.

 
Pul-Adgi Mo-UlStan:

how to do it, at least write where OrderCloseTime()----)))))))))))))))

I also asked this question, unfortunately only a few people on the forum know the answer, here is the beginninghttps://www.mql5.com/ru/forum/6343/page1096#comment_12518595

here is the solutionhttps://www.mql5.com/ru/forum/6343/page1098#comment_12519819

this is a universal solution:https://www.mql5.com/ru/code/16006

 
Igor Makanu:

I asked this question too, unfortunately only a few people on the forum know the answer, here is the beginninghttps://www.mql5.com/ru/forum/6343/page1096#comment_12518595

here is the solutionhttps://www.mql5.com/ru/forum/6343/page1098#comment_12519819

this is a universal solution:https://www.mql5.com/ru/code/16006

It is not very nice and correct to give libraries as tutorials in MQL5 - they provide zero knowledge. Libraries are needed for those who already understand what's what.

Reason: