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 propose a solution through 'OnTradeTransaction': as soon as the transaction 'TRADE_TRANSACTION_DEAL_ADD' is caught -> we turn to the trading history 'HistoryDealSelect' -> if this is the deal 'DEAL_TYPE_BUY' or 'DEAL_TYPE_SELL' -> print out the data:
Result:
and
seems i cant make this work all i get is this error below!
'HistoryDealGetInteger' - no one of the overloads can be applied to the function call
Can you try whether the following code works for you?
This code is not optimised, just thrown together as experiment. I think it works for me.
I propose a solution through 'OnTradeTransaction': as soon as the transaction 'TRADE_TRANSACTION_DEAL_ADD' is caught -> we turn to the trading history 'HistoryDealSelect' -> if this is the deal 'DEAL_TYPE_BUY' or 'DEAL_TYPE_SELL' -> print out the data:
I just wanted to say that I tried your code and it works perfectly, thank you Vladimir = ).
Regards,
I came looking for the answer, how to find the profit of the last operation.
Since I couldn't find it, I wrote a function for it.
mtype can be DEAL_TYPE_BUY, DEAL_TYPE_SELL, -99(For All Types)
symbol can be Symbol() for the current symbol or ALL for all Symbols
magicx can be the magic number or -1 for any number
double profit = lastTrade( -99, "ALL", 12345 );