I got down to continue with this project but now I found another issue:

For implementing

BrokerTrade (int nTradeID, double *pOpen, double *pClose, double *pRoll, double *pProfit): int

The documentations says:

Number of contracts of the given trade ID number, or 0 when no trade with this ID could be found, or a negative number when the trade was recently closed. When the returned value is nonzero, the output pointers must be filled.

The problem in the case of an open trade is that Oanda rest api offers two endpoints for this as far as I researched, Trades http://developer.oanda.com/rest-live/trades/#getInformationSpecificTrade

and Transactions http://developer.oanda.com/rest-live/transaction-history/#getTransactionHistory

For a closed trade I would have to iterate over all the transactions and found the one associated with the close (close order, stop close, etc) of that trade and there it is the rollover (interest in oanda's terms)

But how can I retrieve the interest so far of an open trade? The closest is a transaction which is the daily interest payment for all the account for the open trades with an asset not for an specific trade with an asset. Is there a way to derive it? Wild guessing I could assign proportionally the interest of one day to the different trades according to the lots each have but it is difficult because a trade can reduce maybe their lots due to lock profit... frown

Is it really necessary to fill that output or Zorro can handle it?

Thanks for your help!

Last edited by Mithrandir77; 03/03/16 07:10.