Hello,
when i do a backtest the OnData function is triggert abd everything works as normal.
however when i go to live traiding it does not get executed somehow.
I tried it out with this example code but “test 1” and “test 2” are not getting logged, only “innit” gets logged.
class DeterminedFluorescentYellowHorse(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2021, 5, 5) # Set Start Date
self.SetCash(100000) # Set Strategy Cash
self.AddEquity("SPY", Resolution.Minute)
self.Log("innit")
def OnData(self, data):
'''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
Arguments:
data: Slice object keyed by symbol containing the stock data
'''
self.Log("Test 1")
if not self.Portfolio.Invested:
self.SetHoldings("SPY", 1)
self.Log("Test 2")
i did research for almost 8 hours now but i cant find the reason why it is not working.
can someone help me what the reason could be?
could the problem be the live server?
Varad Kabade
Hi Daniel zuza,
For issues with live trading, please contact support@quantconnect.com with the live deployment attached. We have a new externally hosted status page if you'd like to check the status of the different QC services: https://status.quantconnect.com/Its powered by true "use" of the platform, so should be genuinely reflective of whether the feature is working.
Best,
Varad Kabade
Daniel zuza
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!