Does anybody know where I can find the average transaction costs (in percentage) for the following assets in Oanda? I have assumed it to be 2e-4 when training my model with Close prices. Yet, it seems to be much higher than that.
assets = ['AUDUSD', 'EURUSD', 'GBPUSD', 'NZDUSD', 'USDCAD', 'USDCHF', 'USDJPY', 'USDNOK', 'USDSEK', 'USDSGD']
Furthermore, do you know which one is better regarding transaction costs for these assets costs? FXCM or Oanda? I am currently placing limit orders as follows based on the standard deviation of log returns. Does anybody have an advise on how this can be improved?
stdarr = np.exp(cc.abs().quantile(0.25).values)
self.Debug(stdarr)
for i, asset in enumerate(assets):
ratio = weights[i] if asset[-3:] == 'USD' else (-1.0*weights[i])
#self.SetHoldings(asset, ratio)
self.Transactions.CancelOpenOrders(asset)
oq = self.CalculateOrderQuantity(asset, ratio)
lp = self.Securities[asset].AskPrice * stdarr[i]
if oq > 0: lp = self.Securities[asset].BidPrice / stdarr[i]
if oq != 0: self.LimitOrder(asset, oq, lp)
Michael Manus
Check out on the left in the Algorith Lab API tab.
what Portfolio["someforexpair"].TotalFees returns.
Michael Manus
also take a look at the orderevent in orders chapter:
orderEvent.OrderFee
Kamer Ali Yüksel
Fees spent are shown as zero in the report, since that Oanda rather uses the spread. Are you sure if that TotalFees or OrderFee would work with Oanda? I also just found this interasting experiment:
https://www.quantconnect.com/forum/discussion/1943/fxcm-vs-oanda-fees-and-commissions-impact-an-experiment/p1
Michael Manus
ah ok cool you found something useful.
yes you are right i fogot that oanda don't charge fees.
Kamer Ali Yüksel
Michael, I don't know the situation with FXCM, can I get those statistics from that?
Douglas Stridsberg
Kamer - this file outlines the default FXCM fees. Since those are explicit fees, they would show up as fees in Lean.
As you've pointed out, Oanda charges only spreads. To calculate a "transaction cost" you first have to define what unit this is in. $ per lot? Local ccy per lot? To make it comparable, you should ideally calculate costs as $ per lot and also you may want to volatility/correlation-adjust these (i.e. a higher vol pair will need to be traded in smaller amounts than a lower vol pair).
Due to FX conventions this calculation is not straightforward, as each pair's tick size and tick value will potentially be different. If I were you, I'd set this up in a spreadsheet and find the information needed for each pair. If you need more guidance, let me know, I ran through this excercise myself not too long ago.
Jack Simonson
Hi all,
There is also useful information here that details our Fee Models for the different Forex exchanges, and you can customize fee models (i.e., if you want to replicate how a different exchange might operate) using the Fee Model class.
Erik Bengtson
for Oanda you can get Bid/Ask prices on the security itself. For overnight costs, I shared a code a few days ago on how to calculate that
Kamer Ali Yüksel
Thanks Erik. I did not even now there are overnight costs. Also, I am curious if costs would change if I trade with a much larger portfolio than $100K. I am basically trying to make an AI for hedge-funds; hence in my case increasing the portolio size for the backtest could be reasonable if that would reduce the transaction cost. I would welcome if anybody can enlighten me also in this respect.
Erik Bengtson
It's not a fixed cost, but based on interest rate and position size. For example today holding a 5000 units long position on SOYBEANS, equivalent to one contract, charges around 10 euros per day for a position size of about 45K.
Kamer Ali Yüksel
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!