Back

Can't add Logs

Hi,

I'm new to the platform. I'm trying to analyse my code by adding Logs but no Logs are getting added.

class MultidimensionalTachyonReplicator(QCAlgorithm):

def OnData(self, data):
        self.Log("check.check")
        if not self.Portfolio.Invested:
          self.SetHoldings("SPY", 1)

 

The Log file generated has no manual entries.(The RuntimeError occurs after OnData() gets excecuted.

2014-11-01 00:00:00 Launching analysis for e916c25f9f46f645a51d881deabed7ab with LEAN Engine v2.4.0.0.7642
2014-11-03 00:00:00 Runtime Error: NameError : name 'asset1' is not defined NameError : name 'asset1' is not defined
2014-11-03 00:00:00 Algorithm Id:(e916c25f9f46f645a51d881deabed7ab) completed in 22.90 seconds at 0k data points per second. Processing total of 10,088 data points.

Please help.

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 Aditya,

Welcome to QuantConnect!

This error messages suggests that the error is originating from somewhere else:

2014-11-03 00:00:00 Runtime Error: NameError : name 'asset1' is not defined NameError : name 'asset1' is not defined

It seems like there is variable named asset1 being used which has not been defined.

Without seeing the entire code snippet, it is difficult to determine what is causing the error.

Best
Rahul

1

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.


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