Hi
I have been porting my algos across from Quantopian. The schedule functions used at quantopian allow you to action a function on the first or subsequent trading day of the week. Quantconnect only seems to allow for a function to be scheduled on a specific day (e.g. Tuesday).
Q1. If a function is schedualed on a monday but monday is a holiday, will the function be actioned on the next trading day?
Q2. What is the easiest way to scheduale a function to be actioned on a specific trading day in the week (e.g. the first trading day or the second)?
I am coding in python. I believe the TradingCalander may be useful; however I am not familiar with how it works. I appreciate any help!
Michael Manus
I am only a c# developer but i would take a look at the info provided by tradingcalender.
like GetTradingDays(DateTime start, DateTime end)
TradingDayType: BusinessDay | PublicHoliday
Flame
Thank you - I will try to think of a way to utilise the feature
Michael Manus
1 )when you go in the "Algorithm Lab" on the left there is the "API" - tab
2) expand QCAlgorithm then expand TradingCalendar
3) click on the return value to see the propierties
TradingDays
gl
Michael Manus
Jared Broad
DONT CLICK ON "Quantconnect.Tradingday" link because you will not see the properites!!
BECAUSE ITS THE "SYMBOL" !!! CLASS hehe :) thats the wrong class
Michael Manus
@Jared
GetDaysBuyType also shows symbol class information :)
if you click on the first two decriptions links
Derek Tishler
Recently DateRules for WeekStart WeekEnd and MonthStart MonthEnd were added to Lean, Not in the docs yet but they exist around the codebase:
Flame
Perfect - thank you both for your help. Do you know if the new DateRules allow to offset days?
Flame
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!