Alexey Viktorov: And who forbids checking if(!PositionSelectByTicket(trans.position)) and removing those pending positions???
Situation step by step
Initial BuyLimit and SellLimit for 1 lot, no open positions.
BuyLimit triggers - its SL/TP-trends appear. An open Buy position is 1 lot.
SellLimit triggers - its SL/TP-positions appear. There is no position opened.
For hedges this situation is identical to the one when there are two oppositely directed positions and SL/TP-positions are set for each of them. It is exactly the same in this case, only in Netting the oppositely directed positions are not visible.
Initial BuyLimit and SellLimit for 1 lot, no open positions.
BuyLimit triggers - its SL/TP-trends appear. An open Buy position is 1 lot.
SellLimit triggers - its SL/TP-positions appear. There is no position opened.
For hedges this situation is identical to the one when there are two oppositely directed positions and SL/TP-positions are set for each of them. It is exactly the same in this case except that oppositely directed positions are not visible on the Netting.
Why remove something that should remain? It is a perfectly normal situation when there are two differently directed "positions" with their SL/TP.
You don't seem to understand the task at all or you present it as primitive. Expert Advisor must always trade, even if the user has started to trade with his hands in parallel.
В последние полтора года компанией MetaQuotes была проведена масштабная работа по объединению торговых платформ MetaTrader 4 и MetaTrader 5 в единую трейдерскую экосистему. Теперь для обеих платформ существует общий рынок программных решений - Маркет, предлагающий различные программные решения от сторонних разработчиков. Компиляторы для обеих...
Initial BuyLimit and SellLimit for 1 lot are standing, no open positions.
BuyLimit triggers - its SL/TP puts appear. An open Buy position is 1 lot.
SellLimit triggers - its SL/TP-positions appear. There is no position opened.
For hedges this situation is identical to the one when there are two oppositely directed positions and SL/TP-positions are set for each of them. It is exactly the same in this case, only in Netting the oppositely directed positions are not visible.
fxsaber:
Why remove something that should stay? It's perfectly normal to have two differently directed "positions" with their SL/TPs.
You don't seem to understand the problem at all or present it as primitive. Expert Advisor must always trade, even if the user starts to trade with hands in parallel.
The presence of positions and DEAL_ENTRY flags should not be involved in the logic in any way.
Yes, they should...
Here is the situation: We have a 1 lot position and a 0.1 lot stop order.
A stop order is activated and we obtain a TRADE_TRANSACTION_DEAL_ADD and DEAL_ENTRY_IN transaction.
As a result of this event, part of the position is closed and a new transaction TRADE_TRANSACTION_DEAL_ADD but with DEAL_ENTRY_OUT is received
Hence, there is the double transaction type and necessity of controlling the transaction direction.
You should be involved...
Situation: We have a 1 lot position and a 0.1 lot stop order.
A stop order is activated and a TRADE_TRANSACTION_DEAL_ADD and DEAL_ENTRY_IN transaction is received
As a result of this event, part of the position is closed and a new transaction TRADE_TRANSACTION_DEAL_ADD but with DEAL_ENTRY_OUT is received
Hence the double transaction type and the need to control the direction of the trade.
To disprove this statement, just run the Expert Advisor I cited. Unfortunately, it is the weekend, so it will not work.
Forum on trading, automated trading systems and strategy testing
OnTradeTransaction processing
fxsaber, 2019.02.08 17:41
It is quite possible to have a netting position of zero, but there are two SLs and two TPs.
To disprove this assertion, all you have to do is run the advisor that I cited. Unfortunately, it's the weekend, so it won't work.
And who forbids checking if(!PositionSelectByTicket(trans.position)) and removing those pending positions???
Situation step by step
Situation step by step
Forum on trading, automated trading systems and strategy testing
OnTradeTransaction Processing
Alexey Viktorov, 2019.02.09 12:10
And who forbids to check if(!PositionSelectByTicket(trans.position)) and remove those pending orders???Why remove something that should remain? It is a perfectly normal situation when there are two differently directed "positions" with their SL/TP.
You don't seem to understand the task at all or you present it as primitive. Expert Advisor must always trade, even if the user has started to trade with his hands in parallel.
Article on the subject.
Forum on trading, automated trading systems and strategy testing
OnTradeTransaction processing
fxsaber, 2019.02.09 12:14
Situation step by step.
fxsaber:
Why remove something that should stay? It's perfectly normal to have two differently directed "positions" with their SL/TPs.
You don't seem to understand the problem at all or present it as primitive. Expert Advisor must always trade, even if the user starts to trade with hands in parallel.I don't see it. The inverted commas are there for a reason.
I don't see it. The inverted commas are there for a reason.
So there are no positions, or are they in inverted commas?
So are there no positions, or are they in inverted commas?
Watch this video from 01:35 and 03:35.