vdemydiuk / mtapi

MetaTrader API (terminal bridge)
http://mtapi4.net/
MIT License
521 stars 281 forks source link

How to get history profit record? #165

Open michealChin opened 5 years ago

michealChin commented 5 years ago

Hi,

I would like to know how to get the history profit record that I have made in the pass. I have try the example MtApi5TestClient but it seems only return the active trade profit which is zero if currently you don't have any active trade. Any help will be much appreciated.

Thanks!

vdemydiuk commented 4 years ago

If I understood you correct you can use function HistoryDealGetDouble with argument ENUM_DEAL_PROPERTY_DOUBLE.DEAL_PROFIT to get information about profit of position. You need to call function HistorySelect(from_date,to_date).

Please try to to find related solution on MQL language and than you can use the same functionality in MtApi.