Back

Setting "Start of trading day" to 22:00 UTC

Hi,

is it possible to set the general setting for start of trading week to e.g. 22:00 UTC on sunday.

and/or start of trading day to everyday 22:00 UTC.

more or less setting an offset to the base time?

thx.

 

Update Backtest







0

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.


Hi,

These times are set manually for each security in the market-hours-database.json file. You could of course edit that file if you're running LEAN locally, but I'd advise against it as those hours are set for a reason.

If you can explain why you want to change the start of trading day, perhaps there's an alternative way we can propose?

0

Hello Douglas,

the ticker SPX500USD from Oanda starts each day at 22pm for 23 trading hours. Weekly start is on sunday 22pm.

That is how Oanda provides its data to tradingview. So the daily and weekly bars are generated based on this starting times.

As I am using tradingview to validated my strategies, it is not possible/practical for the ticker SPX500USD (and maybe other tickers from Oanda as well) because on quantconnect the trading day starts at 0:00am.  

Do you have an idea how to handle that? thx.

0

Hey, would changing the timezone in Tradingview fix your problem? You can change the timezone in the lower right hand corner.

37376_1562314003.jpg

0

Hey,

no, it doesn't change the bar calculation. I discussed that already with the TD Support. According to their support, TD is getting the start of week and start of day directly from Oanda, which is at 22pm UTC.

That leads to different values of indicators and OCHL values, which makes a visual strategy validation almost impossible. 

0

I see now what you mean, let me clarify a few things:

  • In QuantConnect the trading day ends at midnight of the data timezone. In the market-hours JSON file this can be found here.
  • In QuantConnect, the Sunday trading day starts at 17:00 Chicago time (22:00 UTC), this can be seen here.
  • QuantConnect will produce one Sunday bar from 22:00 UTC to 00:00 UTC and then a Monday bar from 00:00 UTC to 00:00 UTC the next day. This is arguably more correct as it clearly shows there is trading taking place on the Sunday and then the Monday, instead of just one big Monday bar.

As far as I'm aware, there's no way to strictly control the opening and closing times of the bars. A few months ago I made public a time-zoned daily bar consolidator for LEAN which would be helpful to you if you ran LEAN locally. If you don't, you'll have to live with the discrepancy between Tradingview and QuantConnect. Starting your trading week at 22:00 UTC Sunday (midnight Moscow/Madagascar/Saudi Arabia?) seems really arbitrary.

1

Thx Douglas. 

At least I know now that there is no "easy" way to solve that. Trapped between systems ;)

0

Update Backtest





0

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.


Loading...

This discussion is closed