
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
I'm putting it out there for the public to judge. Although I haven't attached any checks yet, but I think they should work.
And somewhere in OnTick:DelitClosePositionFromArrayPosition();
Good afternoon, and once again I'm begging. Second day I can't understand why this piece of code doesn't work
Print "Deal entered...." goes fine, then there should be a split, some deals"Open position ...." are printed, but all other deals (these are deals closing position on TakeProfit) are not printed.
I do not understand what is the problem. I will mark the lost trades in colour below.
So it's like SOS !!!
Alexey, it all refers only to OnTradeTransaction event handling
An event has occurred, a trade that closes a position has been executed. The position is already gone at this moment. You can confirm it by selecting a list of orders and deals (there is no such a list in the code) and reading
And note that we are talking about a hadge account where the position usually has only two orders and two trades.Good afternoon, if it's not too much trouble for you, you have accurately described everything in this post. My two posts above, I am trying to get the result I need - to commit to close a position. I still cannot do it.
Please advise me, where I have a mistake or defect ?????
And this way there is no separation at all, it turns out that closing of a position at TakeProfit also fits under DEAL_ENTRY_IN?
It seems to me that some changes have been made to the handling of the OnTradeTransaction event.
Try to replace TRADE_TRANSACTION_DEAL_ADD with TRADE_TRANSACTION_HISTORY_ADD
It seems to me that some changes have been made to OnTradeTransaction event handling.
Try replacing TRADE_TRANSACTION_DEAL_ADD with TRADE_TRANSACTION_HISTORY_ADD
Doesn't help. Thank you for your feedback.
It seems to me that some changes were made to OnTradeTransaction event handling.
Try to replace TRADE_TRANSACTION_DEAL_ADD with TRADE_TRANSACTION_HISTORY_ADD
Transactions opening positions are printed, i.e. this selection works. But it is not clear how to select trades - closing positions, even though they are visible in the list of terminal transactions (a couple/three lines higher always).
I'll try it from the beginning, because my head is already a mess. As the movie classic said - "Who builds like this.....????".
There isa trade transaction, but there is no trade ticket yet. Am I getting this right?
Transactions opening positions are printed, i.e. this selection works. But how to select transactions - closing positions - is not clear, even though they are visible in the list of transactions of the terminal (a couple / three lines higher always).
Try to pass in the debugger by pressing the blue button.
pre-set breakpoints and check where the values are and what values are expected. OK, I don't seem to see any errors, so I have to check, hence write open positions, adjust stops so that I don't have to wait long to close...
I'll try it from the beginning, because my head is already in a mess. As the movie classic said - "Who builds like this.....????".
There is a trade transaction, but there is no trade ticket yet. Am I reading this right?
I don't understand anything at all. Here's a piece of code from my running EA
And it never stopped on DebugBreak(); so everything works out without any problems.
Apparently you have an order being added to history and you're waiting for a trade ticket.