Back

Problem executing self.Web.Notify

Hi guys,

 

Anybody else run into problem executing self.Web.Notify method in Python?

2013-10-07 00:00:00 An unknown error occurred .<class 'AttributeError'>

 I've identified the line of code in following algo that bombs is the one sending the self.WebNotify message with a data object as the second argument.

self.Notify.Web("http://www.tradejolt.com/wordpress/qj_sms_forwarder.php",self.signal)

Please note: although this message will only get sent in live mode, it should still gracefully exit without an error in test mode. That is not happening.

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.


Just removing all the try-catch layers I got a nice exception.

During the algorithm initialization, the following exception has occurred: AttributeError : 'BasicTemplateAlgorithm' object has no attribute 'signal'
at Initialize in main.py:line 14
at testNotify in main.py:line 24
AttributeError : 'BasicTemplateAlgorithm' object has no attribute 'signal'

After initializing the signal object there was an issue with that type though, so I played and got it working with: 

self.Notify.Web("http://www.tradejolt.com/wordpress/qj_sms_forwarder.php", "simple data" )

I don't think it'll work with complex objects but it does support strings/ints/floats. Recommend serializing your object in python first then passing the string through.

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.


Hi Jared,

 

Thanks. That put me on the right track. Here's the finished version, which also handles serializing the complex data object with a string and a timestamp. Hope that can help someone else.. Now I wll go run it live, and see if I get sms forwarder does its job.

1


Thanks Serge! 

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.


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