Download MetaTrader 5

2nd EA for trailing

To add comments, please log in or register
What is MetaQuotes ID? Find that out from the article!
Jan Tarnogrocki
6335
Jan Tarnogrocki 2015.05.23 16:21 

Hi!

I want to run a second EA on a second server for the case that the first server goes down and orders stay open. In that case an EA on the second server shall trail the stop loss of the remaining orders.

As long as both servers are running both EAs would try to trail the stop loss. That would mean the broker gets the command for trailing most of the time twice. Would that cause any problems? Does someone has experience about that?

Another idea would be that the second EA would only start to trail if the first server is down. Both EAs would need to communicate in some way with each other. I did not code something like that yet. Is it possible to do and if yes how?

Kind regards and thanks for any answer!
Jan.

Yury Kirillov
3263
Yury Kirillov 2015.05.23 16:34  

 A reasonable idea to use a second parallel terminal for one account - hangs the first terminal of the second continues to operate normally. I used two terminals with the same advisor and without problems. In addition, experts pereustanav very aggressive on every tick - and I have never received from the broker restrictions due to high demand.

 Разумная идея, чтобы использовать второй параллельный терминал для одной учетной записи - при зависании первого терминала второй обычно продолжает работать. Я использовал два терминала с одним и тем же советником и проблем не было. Кроме того, эксперты весьма агрессивно переустанавливали параметры ордеров на каждом тике, - и я никогда не получал ограничений от брокера в связи с высокой частотой запросов.

Dua Yong Rew
5422
Dua Yong Rew 2015.05.24 04:05  
Jan Tarnogrocki:

Hi!

I want to run a second EA on a second server for the case that the first server goes down and orders stay open. In that case an EA on the second server shall trail the stop loss of the remaining orders.

As long as both servers are running both EAs would try to trail the stop loss. That would mean the broker gets the command for trailing most of the time twice. Would that cause any problems? Does someone has experience about that?

Another idea would be that the second EA would only start to trail if the first server is down. Both EAs would need to communicate in some way with each other. I did not code something like that yet. Is it possible to do and if yes how?

Kind regards and thanks for any answer!
Jan.

trail with global variables, hide your stop from your broker
Jan Tarnogrocki
6335
Jan Tarnogrocki 2015.05.24 08:59  
Yury Kirillov:

 A reasonable idea to use a second parallel terminal for one account - hangs the first terminal of the second continues to operate normally. I used two terminals with the same advisor and without problems. In addition, experts pereustanav very aggressive on every tick - and I have never received from the broker restrictions due to high demand.

 Разумная идея, чтобы использовать второй параллельный терминал для одной учетной записи - при зависании первого терминала второй обычно продолжает работать. Я использовал два терминала с одним и тем же советником и проблем не было. Кроме того, эксперты весьма агрессивно переустанавливали параметры ордеров на каждом тике, - и я никогда не получал ограничений от брокера в связи с высокой частотой запросов.   THANKS FOR YOUR ANSWER

(answering is does not work properly with my mobile browser)






Jan Tarnogrocki
6335
Jan Tarnogrocki 2015.05.24 09:01  
Dua Yong Rew:
trail with global variables, hide your stop from your broker
The EAs are running on different MT4 terminals on different servers. Global variables does not help.
Dua Yong Rew
5422
Dua Yong Rew 2015.05.25 03:27  
Jan Tarnogrocki:
The EAs are running on different MT4 terminals on different servers. Global variables does not help.
if it is the same account, the EA can have its own global variable to manage the trade.
cyberryder
555
cyberryder 2015.06.09 23:36  

1) As long as both servers are running both EAs would try to trail the stop loss. That would mean the broker gets the command for trailing most of the time twice. Would that cause any problems? Does someone has experience about that?

->  With your idea of a failover solution, you would ideally place a VPS in LD4 + NY4 each. The terminal with the higher latency will cause slippage, if the order is opened, modified, closed by a command of it. You play russian roulette and increase the risk without need.

-> Only solution that might work is to place both VPS's at the same hoster in the same DC. Orders will still interfere a bit, but slippage and execution is the same then, so it should not matter that much. It should not be much different than placing the same EA on 2 charts. However this VPS setup makes not much sense for me. I did not test this.


2) Another idea would be that the second EA would only start to trail if the first server is down. Both EAs would need to communicate in some way with each other. I did not code something like that yet. Is it possible to do and if yes how? 

--> You need terminal 1 on VPS 1 to periodically send a heartbeat to terminal 2 on VPS 2. I did not check deeper, but FxBlues trade copier over internet coud be a workaround, because they use such heartbeat http://www.fxblue.com/appstore/app.aspx?id=21&sort=popularity

--> Terminal1 on VPS1 is periodically modifying a pending order every 10sec on an impossible to reach trading level. Terminal2 on VPS2 monitors those modifications. If no modification for 30seconds, Terminal2 on VPS2 starts to manage the trade. 

Jan Tarnogrocki
6335
Jan Tarnogrocki 2015.06.13 20:15  
cyberryder:

1) As long as both servers are running both EAs would try to trail the stop loss. That would mean the broker gets the command for trailing most of the time twice. Would that cause any problems? Does someone has experience about that?

->  With your idea of a failover solution, you would ideally place a VPS in LD4 + NY4 each. The terminal with the higher latency will cause slippage, if the order is opened, modified, closed by a command of it. You play russian roulette and increase the risk without need.

-> Only solution that might work is to place both VPS's at the same hoster in the same DC. Orders will still interfere a bit, but slippage and execution is the same then, so it should not matter that much. It should not be much different than placing the same EA on 2 charts. However this VPS setup makes not much sense for me. I did not test this.


2) Another idea would be that the second EA would only start to trail if the first server is down. Both EAs would need to communicate in some way with each other. I did not code something like that yet. Is it possible to do and if yes how? 

--> You need terminal 1 on VPS 1 to periodically send a heartbeat to terminal 2 on VPS 2. I did not check deeper, but FxBlues trade copier over internet coud be a workaround, because they use such heartbeat http://www.fxblue.com/appstore/app.aspx?id=21&sort=popularity

--> Terminal1 on VPS1 is periodically modifying a pending order every 10sec on an impossible to reach trading level. Terminal2 on VPS2 monitors those modifications. If no modification for 30seconds, Terminal2 on VPS2 starts to manage the trade. 

Thank you very much for that answer!

2) Something like a heartbeat is what I was thinking about, too. I´ll check the link and if I am able to code it.

1)Why should that cause slippage? Commanf for modify the stop loss will be send twice. First command will trail the SL. Second tries to trail the SL to a value where it is already. The broker will not change the SL a second time. !?

cyberryder
555
cyberryder 2015.06.13 21:16  

the last one is a separate idea and i think the most simplest, nothing to do with FxBlue. "--> Terminal1 on VPS1 is periodically modifying a pending order every 10sec on an impossible to reach trading level. Terminal2 on VPS2 monitors those modifications. If no modification for 30seconds, Terminal2 on VPS2 starts to manage the trade. "

you would only need to code 2 little EA's for this who both look on the same trading account 

To add comments, please log in or register