You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.