Hello,
I did a quick scan through the API, but nothing jumps out at me. Please forgive me if this has been answered a billion times. Is there a way to get OnData to not be midnight on a Daily resolution?
I know one fix could be to set a callback for a certain time of day, but then are my daily indicators only updated at midnight? I'd rather them be updated right before I make trading decisions based on them.
Thanks,
Jeff
Jack Simonson
Hi Jeff,
There's a quick trick to doing so and its to subscribe to a 'dummy' security with a higher resolution than the one you are interacting with (i.e. you want to work with AAPL for all trading/indicators, so you would subscribe to SPY with minute-level data). In this example, if you log the OHLC of AAPL, you will see that the logs only cover the standard market hours now and that the OHLC of the daily resolution TradeBar is the same until Market Open of the following day. So, any indicators that you have using daily-resolution data will update once the market closes at 16:00 but now you are able to perform intra-day operations if necessary. Have a look at the backtest I've attached for a brief example.
Jeff Ward
Thanks that's really helpful!
Jeff Ward
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!