The history on an account - closed trades and credit movements - is potentially (a) very large and (b) time-consuming to collect from the broker's back-end system. The Framework.TradeHistory is empty by default, and must explicitly be filled by using
You can be notified when the history loads (or is later added to) in three ways.
Firstly, you can provide a callback to
Or, you can use the Promise version of the function,
await Framework.pRequestAccountHistory();
// Framework.TradeHistory will now have been populated
Or, you can set up a message handler and watch for messages of type ACCOUNT_HISTORY.
There can be a long delay between using
The contents and detail of the history are slightly variable depending on the capabilities of the account. For example, a couple of broker back-end systems can only provide the historic trades on an account, not the credit movements.