Hi
I'm using consolidated bars and noticed that the open price can be different between two bars, even when they open at the same time.
I am using minute bars for NATGASUSD from Oanda - so here is a minute bar starting at 1840-1841 on 2nd May 2021:
{
"LastBidSize": 0.0,
"LastAskSize": 0.0,
"Bid": {
"Open": 2.874,
"High": 2.874,
"Low": 2.872,
"Close": 2.872
},
"Ask": {
"Open": 2.885,
"High": 2.885,
"Low": 2.883,
"Close": 2.883
},
"Open": 2.8795,
"High": 2.8795,
"Low": 2.8775,
"Close": 2.8775,
"EndTime": "2021-05-02T18:41:00",
"Period": "00:01:00",
"DataType": 4,
"IsFillForward": true,
"Time": "2021-05-02T18:40:00",
"Symbol": {
"Value": "NATGASUSD",
"ID": "NATGASUSD 8I",
"Permtick": "NATGASUSD"
},
"Value": 2.8775,
"Price": 2.8775
},
But when I use a 10 minute consolidated bar for the same setup, I get this for the 1840-1850 bar - note the different Open price.
{
"LastBidSize": 0.0,
"LastAskSize": 0.0,
"Bid": {
"Open": 2.872,
"High": 2.874,
"Low": 2.872,
"Close": 2.874
},
"Ask": {
"Open": 2.883,
"High": 2.886,
"Low": 2.883,
"Close": 2.886
},
"Open": 2.8775,
"High": 2.880,
"Low": 2.8775,
"Close": 2.880,
"EndTime": "2021-05-02T18:50:00",
"Period": "00:10:00",
"DataType": 4,
"IsFillForward": false,
"Time": "2021-05-02T18:40:00",
"Symbol": {
"Value": "NATGASUSD",
"ID": "NATGASUSD 8I",
"Permtick": "NATGASUSD"
},
"Value": 2.880,
"Price": 2.880
}
Why would the open of these two bars differ when they both open at 1840?
Any ideas?
Thanks
Matt
MattG
Hi
Thought attaching a code example on how to reproduce might be useful:
Anyone any ideas on this?
Thanks
Â
Derek Melchin
Hi MattG,
The consolidated bar spanning 18:40 to 18:50 has a different opening price than the 1-minute bar spanning 18:40-18:41 because the 18:40-18:41 bar contains fill-forward data. The first minute-bar between 18:40 and 18:50 that doesn't contain fill-forward data has an open price of $2.8775 (which matches the open price of the consolidated bar).
See the logs of the attached backtest.
Best,
Derek Melchin
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.
MattG
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!