Errors, bugs, questions - page 941

 
Rosh:

Look in the terminal's built-in help - MetaTrader 5 HelpGetting StartedLaunching the terminal:

If you do not want to have problems with the security system - do not install the terminal into/Program Files/ .

Read also the article A quick dive into MQL5


Thank you .....
 
Yedelkin:

I wanted to create a script that inspects the line of the indicator (similar to the MA, but in a separate window and reset to 0, but that's not the point) for the swing to zero, crossings, etc., then the script changes the indicator parameters and analysis again, the result is a table with the data, or rather a file with the results

i can't use it as a script, so now i do as owls that look through the indicator values during optimization and save them in the DeInit function, adding the data during each pass. The result will be the same table with the same 10000 values of the indicator


more suggestions will be welcome

 

All in all, it worked, although it is slower through the tester than through the script, but any number of indicators,

And when testing I had to disable all cores, only test on 1 because the results are divided into several parts, but I think it is easier to copy everything to 1 file than to wait

 

Why does terminal.exe load a 2x core processor 50% when there are 7-10 active custom indicators, MT4 does not load ?

Переход на новые рельсы: пользовательские индикаторы в MQL5
Переход на новые рельсы: пользовательские индикаторы в MQL5
  • 2009.11.23
  • Андрей
  • www.mql5.com
Я не буду перечислять все новые возможности и особенности нового терминала и языка. Их действительно много, и некоторые новинки вполне достойны освещения в отдельной статье. Вы не увидите здесь кода, написанного по принципам объектно-ориентированного программирования — это слишком серьезная тема для того, чтобы просто быть упомянутой в контексте как дополнительная вкусность для кодописателей. В этой статье остановимся подробней на индикаторах, их строении, отображении, видах, а также особенностях их написания по сравнению с MQL4.
 
dav1977:

Why does terminal.exe load a 2x core processor 50% when there are 7-10 active custom indicators, MT4 does not load ?

Not enough details. How do you compare? What indicators exactly? What else is going on in the terminal? Do you have the source code of the indicators? On which symbol/period?

 
My impression is that MT5 runs on a single CPU agent. I.e. on a 4 core processor MT5 would load 25% of the power. E.g. when testing or working normally on my 2 core it's also 50%, but when optimising it loads all agents and goes to 100%.
 

Hello. The problem in MetaTrader FOUR

Problem with pending orders in the tester, specifically the expiry date.

   ticket=OrderSend(symb, OP_SELLLIMIT, Lots, price, Slippage, 0, 0, lsComm, mn, TimeCurrent() + 60*60, op_color);

This is how a new order is opened, i.e. if it has not been triggered in one hour, the server should close it.

Then I check what is the expiry date:

   if (ticket>0)
   {
    OrderSelect(ticket, SELECT_BY_TICKET);
    Alert("OrderExpiration = ", TimeToStr(OrderExpiration(), TIME_DATE),":",TimeToStr(OrderExpiration(), TIME_MINUTES)); 
.......
   } 

This is what I get when the EA works in the tester:

2013.03.01 12:45:58 2012.01.11 11:00 #advisor# EURUSD,H1: open #1 sell limit 2.00 EURUSD at 1.27972 ok
2013.03.01 12:45:58 2012.01.11 11:00 #advisor# EURUSD,H1: Alert: OrderExpiration = 2012.01.11:12:00
2013.03.01 12:45:58 2012.01.12 16:29 Tester: order #1, sell 2.00 EURUSD is opened at 1.27972

That is, date and time of expiry are set correctly, as I want, but I do not close at the time of expiry - a position is opened after 24 hours.

I searched a few forums, the problem has occurred for a long time.

 
alexvd:

Few details. How do you compare? What indicators? What else is going on in the terminal? Do you have the source code of the indicators? On which symbol/period?

Comparing the indicators in MT4 I have written and transferred to MT5. Only indicators in terminal. I have sources. RTS fuchs does not depend on the symbol. Period M1

The Trouble is that because of CPU load new candlesticks and prices stop drawing !!!!!!!!!!!!!!!.

(Figures https://www.mql5.com/ru/forum/9926/page4 )

БКС запустила MetaTrader 5 на ФОРТС
БКС запустила MetaTrader 5 на ФОРТС
  • www.mql5.com
MetaTrader 5 - программа, предназначенная для торговли через интернет на рынке ФОРТС и других финансовых рынках.
 
dav1977:

Comparing the indicators in MT4 I have written and transferred to MT5. Only indicators in terminal. I have sources. RTS fuchs does not depend on the symbol. Period M1

The Trouble is that because of CPU load new candlesticks and prices STOP drawing !!!!!!!!!!!!!!!

(Figures https://www.mql5.com/ru/forum/9926/page4 )

I have a suspicion that the transfer from 4 may have been done without taking into account the features of 5. And the CPU load and the rendering of candlesticks is only a consequence of too heavy calculations or waiting cycles etc. in OnCalculate.
 

Good afternoon, everyone! I'm asking for help from experienced people.

The situation is as follows. I am trying an MT5 on forex. I have an Expert Advisor that places Stop Buy and Stop Sell pending orders by the signal.

When running the Expert Advisor in the strategy tester, I notice that a Stop Buy order placed by the Expert Advisor is triggered (a deal is opened) earlier than it should be in accordance with the price at which the order must be executed.

The structure of a trade request to place a Stop Buy pending order is as follows:

mrequest.action = TRADE_ACTION_PENDING;                                         
mrequest.symbol=_Symbol;                                                       
mrequest.volume= Lots;                                                         
mrequest.price = NormalizeDouble(mrate[1].close+StopSell*_Point,_Digits);        
mrequest.stoplimit = NormalizeDouble(mrate[1].close+StopSell*_Point,_Digits);    
mrequest.tp = NormalizeDouble(mrate[1].close+StopSellTake*_Point,_Digits);       
mrequest.type = ORDER_TYPE_BUY_STOP;                                            
mrequest.type_filling = ORDER_FILLING_RETURN;                                      
mrequest.type_time = ORDER_TIME_SPECIFIED_DAY;      
mrequest.expiration = TimeCurrent();

In expressions

mrate[1].close+StopSell

и

mrate[1].close+StopSellTake

There is no error, they give us the price at which the order must be executed and the Take Profit price.


Correspondingly, my question is: at what price does MT5 check the conditions for triggering of pending Stop Buy and Stop Sell orders - at the Ask and Bid price or at the price of the last trade?

Since you are going to use the Expert Advisor on the real FORTS, I want the trigger price to be the last trade price.

I have an assumption that the test trigger price is either ask or bid; therefore, the appropriate trigger price is not available on the chart at the last trade price. I've read in the manual that "The order triggering for instruments in the "Exchange execution mode" is performed at the Last price (price of a last trade executed). I check the execution mode for the symbol I need RIH3

Print("Режим исполнения сделок: ", SymbolInfoInteger(_Symbol, SYMBOL_TRADE_EXEMODE));

the terminal returns "Trade execution mode: 3". 3 seems to be a stock execution, i.e. the trigger price should be Last. But pending orders are executed as before when the trigger price is not yet on the chart.

I'm testing on FORTS broker's demo server.


Reason: