self.Notify.Email("myemail@gmail.com", "Test", "Test Body", "test attachment")
How does one generate an attachment to send with the email? Or even the "Test Body"? What is the best way of amalgamating all orders (say 5 orders all sent off at one time) and sending it out as a text file?
I can see how to create a log of orders but I am not sure how they should be included in or atteched to an email. Any help would be appreciated.
I am about to subscribe to a live trading node.
Anthony FJ Garner
I am not sure whether one can open and write to a text file in Quantconnect - I guess I must experiment. In the interim I will just try to email crude strings:
for share in changes.RemovedSecurities:
if share.Invested:
self.Liquidate(share.Symbol)
tempvar = (str(share.Symbol.Value)
+ " " + "Quantity"+ " " + str(self.Portfolio[share.Symbol].Quantity)
+ " " + "Price" + " " + str(self.Portfolio[share.Symbol].Price))
self.exits = self.exits + " " +tempvar
Â
Derek Melchin
Hi Anthony,
To send an attachment with the email, we just need to pass the attachment's contents as a string.
self.Notify.Email('derek.melchin@quantconnect.com', 'Subject Text', 'Message Text', 'Attachment Text')
The 4th string passed to the method above is parsed into a .txt file and attached to the email.
Best,
Derek Melchin
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.
Anthony FJ Garner
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!