The data being displayed in debugger by my algorithm for Quotebars (OHLC) is wrong in live connection. Chart and OHLC data don't match. Bid chart is up and I'm lookining right at it, and I'm using bid prices in algo. Each candle is printed in my log, and data doesn't match.
After trying to figure it out for some time, I believe it is using Oanda's regular account data, when my account is a "v20 core pricing account". This account has the benefit of lower spreads, so for instance eur/usd is .2 instead of 1.2 or so.
For an algorith trading price action based off of this data, this is very impactful. Entries, Stops, Targets are all being calculated by Bid OHLC data and it's way off in my case.
Question is: Is there a way to change the brokerage model in code to this account type (Core Pricing) to get the bid/ask data?
Again, this is in a live account, so I thought connecting through the API to the core pricing account would stream those quotes but apparently it doesn't work that way.
Any help would be greatly appreciated!
Jack Simonson
Hi Matt,
Right now the data that we get from Oanda is the standard tick data, so we aren't able to stream the Core Pricing spreads or commissions. However, you can make adjustments for this using our Reality Modelling. It is possible to add a custom Slippage Model that you can adjust for the spread differences and custom Fee Model to mimic the Oanda commissions based on Core Pricing (you can find their pricing information here to make these calculations). A good example of how to set these custom parameters can be found here. Note that any order fills will be done based on Oanda prices/spreads at the Core Pricing, but to mimic this in backtesting it will take some clever customization. You can see an example in the backtest I've attached, where the Custom Fee Model mimics that of Oanda Core Pricing and has an example of a custom Slippage Model.
Matt Murphy
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!