Experts: Opposite trade

 

Opposite trade:

Opening a position opposite to the closed one. Trades are processed in the OnTradeTransaction function.

Author: Vladimir Karputov

 
For some reason, when another Expert Advisor closes a position by take profit, theposition is repeatedly opened and closed every 1-3 seconds, 3-5 times. How can they be coordinated? Or is it possible to introduce a delay before opening the opposite position?
Совершение сделок - Торговые операции - Справка по MetaTrader 5
Совершение сделок - Торговые операции - Справка по MetaTrader 5
  • www.metatrader5.com
Торговая деятельность в платформе связана с формированием и отсылкой рыночных и отложенных ордеров для исполнения брокером, а также с управлением...
 
AngryBirds:
For some reason, when another Expert Advisor closes a position by take profit, theposition is repeatedly opened and closed every 1-3 seconds, 3-5 times. How can they be coordinated? Or is it possible to introduce a delay before opening the opposite position?
How does "another Expert Advisor close a position by Take Profit"? Take Profit is triggered automatically - the Expert Advisor cannot "close a position by Take Profit".

Attention: The "Opposite trade" Expert Advisor DOES NOT CLOSE positions - it only catches the closing of a position and OPENS a position of the opposite direction. You probably have someone else closing positions - another Expert Advisor or you manually.

Describe the situation in detail:

  1. Type of trading account: netting or hedge.
  2. Attach log files (NOT PICTURES!) from the "Experts" and "Journal" tabs.

 

Trailing_Profit does not match with Trailing_Profit Expert Advisor, Trailing_Profit when reaching its "profit" repeatedly tries to close all positions, including "oppositional" positions just opened, which accordingly all go into a small minus. Exp_GStop behaves similarly with Opposite trade. How could these "auto-closers" in the moments of closing with Oppositom be broken?

Files:
zwh2rs.log  27 kb
uyyciwk4.log  58 kb
 
AngryBirds:

Trailing_Profit does not match with Trailing_Profit Expert Advisor, Trailing_Profit when reaching its "profit" repeatedly tries to close all positions, including "oppositional" positions just opened, which accordingly all go into a small minus. Exp_GStop behaves similarly with Opposite trade. How would these "auto-closers" in the moments of closing with Oppositom to make up for it?


This is not a question for Opposite trade. Opposite trade does its job - it opens a position opposite to the closed one. Nobody knows what the other or other Expert Advisors are doing at this moment.

 
AngryBirds:

Trailing_Profit does not match with Trailing_Profit Expert Advisor, Trailing_Profit when reaching its "profit" repeatedly tries to close all positions, including "oppositional" positions just opened, which accordingly all go into a small minus. Exp_GStop behaves similarly with Opposite trade. How could these "auto-closers" in the moments of closing with Oppositom be reconciled?


Another option: writing ONE EA, which will combine the logic and algorithms of THREE EAs.

 

ideally similar 3 in 1 I was looking for on the internet but so far without success, only here is a composite version found, but that turns out to work only in semi-manual mode, unfortunately I am not a programmer.

 
AngryBirds:

Ideally, I was looking for such a 3 in 1 on the Internet, but so far without success, only the composite version found, but that is working only in semi-manual mode, unfortunately I am not a programmer.


The first thing to do is to write a list: and what should do such a composite EA? Approximate list:

  • Should it work on all symbols?
  • Should it copy magics and volumes of positions?
  • ...

After making this list there will be two ways:

  • search for a suitable functionality
  • order code writing in Freelance service

 
Automated-Trading:

Opposite trade:

Author: Vladimir Karputov

Can you add stop loss and trailing profit to this ea? It would be perfect
 
sztusz1 :
Can you add stop loss and trailing profit to enhance this ea ? It would be perfect

See the input parameters. The Expert Advisor is based on the input parameters.