Oanda setcommision and size
J T last edited by
Hi ! Hoping everyone is keeping safe in these times.
Need some help with forex oanda commision. I cannot fully understand the docs.
The commission is in the spread, but under a million shares traded, the commision is $50. Lets say $5 per trade for easy calculation.
Margin for my country is 5% and so I believe leverage is 20x.
Can I ask how do you set cerebro broker is this case?
#This code cannot work... meaning no orders executed, beleive commtype=bt.CommInfo.COMM_FIXED is the issue? cerebro.broker.setcommission(leverage=20, mult=1.0, stocklike=False, automargin=0.05, commtype=bt.CommInfoBase.COMM_FIXED, commission=5.0)
a few more questions
- whats the difference between mult and leverage?
- how do you set the size to buy. Should size include the 20x leverage?
as objective is to trade live on oanda, hence hoping to get this right
amount_to_invest = (0.5 * self.broker.cash) self.size_to_exe = math.floor(amount_to_invest / self.data0.close)
Thanks a million!