Closed irperez closed 5 years ago
@irperez The case happens because the Fee parameter is misused in the builder, the fee here is used for currency exchange when use foreign currency to buy stock, it should be the fee for exchange, and should be a rate (between 0 and 1).
To clarify the use case, I've renamed those method in the Builder class, 'Fee' is changed to 'FlatExchangeFeeRate', 'BuyCompleteCurrencies' is changed to 'BuyWithAllAvailableCash', and moved premium to the Builder class.
The document has also been updated for the case, you can also refer the case there.
That makes a ton more sense. We should put validation so that the Fee is only ever between 0 and 1.
Is there a way to track transaction costs per trade?
The cost are not currently added into each Transaction object, but should be easy to implement, you can study Runner.cs line number 101-147 for creation of Transaction object.
Ok, I'll see if I can make a PR for this.
@irperez Would like to confirm if it has been implemented or abandoned? Thanks.
@lppkarl I've put in a PR for this one. Sorry it took so long.
@irperez it's ok, just want to confirm it's done. Thanks 👍
I'm seeing negative numbers consistently in the Quantity field in the Transactions after a back test run. See below.
And this is the builder code to set things up.