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
Hi , I am writing a code in OnTradeTransaction() event handler ,that whenever order hit stoploss i am taking it's position id of deal type DEAL_ENTRY_OUT and iterating HistoryDealTotal() to find DEAL_ENTRY_In for that position_id but problem is HistoryDealTotal() is holding only latest deal for given position_id , and margin_mode of my account type is Hedging .
output :
expected result: when order closed by hitting stoploss then HistoryDealsTotal() should return 2 but i am getting 1.