Questions from Beginners MQL5 MT5 MetaTrader 5 - page 761

 

I have a question about signals. When connected, are already existing trades that are in drawdown and pending signal orders already placed at the time of purchase copied?

 
Aleksandr Borodavkin:

I have a question about signals. When connecting, are already existing trades that are in a drawdown and pending signal orders already set at the time of purchase copied?


The pending orders are never copied at all - only buy and sell trades are copied. Help:How to set up a trading platform to use signals.

During synchronization, all positions that are on the provider's trading account will be copied.

Как подписаться на сигнал - Торговые сигналы и копирование сделок - Справка по MetaTrader 5
Как подписаться на сигнал - Торговые сигналы и копирование сделок - Справка по MetaTrader 5
  • www.metatrader5.com
Для копирования торговых операций провайдера на собственный счет необходимо оформить подписку на сигнал. За нее может взиматься еженедельная или...
 
Николай Никитюк:

Hello 2017.07.18_18:26 GMT+3. Forum connoisseurs, advise which type of programming to use in order to complete an EA -- procedural or OOP ? I asked the question on page 760. It looks like the standard Moving Average.mq5 Expert Advisor but it is not working. The article https://www.mql5.com/ru/articles/367 calls it "simple rules". What kind of programming should I choose so that my code does not contradict those "simple rules"? So I don't have to write another year of Expert Advisor, I think it could be finished in a month or a year and a half. I hope to get an answer. If you have any questions, please do ask. That is all for now. 18:39 GMT+3. Posted at 18:42 GMT+3.

Use the type of programming that you personally understand.

 

Can you tell me how to retrieve the ticket from the history that was there when it was opened. In the screenshot it is "63214735"

Report file

From terminal from history


 
Vasiliy Sokolov:

Use the type of programming that you personally understand.


+100

 
Can you tell me how to get the ticket that was on the trade from the history. On the screenshot it's "63214735"

Report file


From the terminal from the history


This code is not found

   datetime end=TimeCurrent();
   datetime start=end-PeriodSeconds(PERIOD_D1);// установим начало на сутки назад
//--- запросим в кэш программы нужный интервал торговой истории
   HistorySelect(start,end);
   
   int deals=HistoryDealsTotal(); 
   for(int i=0;i<deals;i++) 
     { 
      if(HistoryDealGetInteger(i,DEAL_TICKET)==63214735)  Alert( deals );
     }
 
Vitaly Muzichenko:
Please advise how to retrieve the ticket from the history, which was at the time of the trade. In the screenshot it is "63214735".

....

This code does not find

I think you should be looking for Position, not Deal

https://www.mql5.com/ru/docs/trading/historyselectbyposition

Документация по MQL5: Торговые функции / HistorySelectByPosition
Документация по MQL5: Торговые функции / HistorySelectByPosition
  • www.mql5.com
Торговые функции / HistorySelectByPosition - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Ivan Ivanov:

I think you should look for Position, not Deal

https://www.mql5.com/ru/docs/trading/historyselectbyposition

Possibly, but so far I can't find anything. You can get those tickets that you don't need

Right now there is an active position, and once it is in the history, you need to find its ticket "63228260"


 

This is the data I got in the tester

01.01.2017-01.06.2017
2017.07.20 00:08:35.127 Core 1 Si-9.17,M1: 46437 ticks, 19260 bars generated. Environment synchronized in 0:00:00.031. Test passed in 0:00:42.151.
2017.07.20 00:08:35.127 Core 1 Si-9.17,M1: total time from login to stop testing 0:00:42.182 (including 0:00:00.031 for history data synchronization)
2017.07.20 00:08:35.127 Core 1 368 Mb memory used including 30 Mb of history data, 64 Mb of tick data

01.06.2017-01.07.2017
2017.07.20 00:13:20.957 Core 1 Si-9.17,M1: 61072 ticks, 16125 bars generated. Test passed in 0:02:12.101 (including ticks preprocessing 0:00:00.016).
2017.07.20 00:13:20.957 Core 1 348 Mb memory used including 32 Mb of history data, 64 Mb of tick data

There are questions:

1. why first period with message "total time from login to stop testing"?

2. the first period contains fewer ticks but more bars, while i am testing with OHLC - the ticks should not affect the testing time?

I am confused by the fact that more time is spent for testing in June - why is that?

 
Ivan Ivanov:
Vitaly Muzichenko:
It's not positions or deals that need to be looked at, but orders, because first comes an order, then a deal, then a position.