Back

Unnecessary logs and trades

Hello everyone,

my algorithm is always submitting orders on the last day of the backtest after market close. These are not filled so it doesn't make a difference but is taking the space of the actual trades. I've got a similar problem with the logs where I get some at the beginning of the backtest at 09:30:01 from a function that should only run every 301 seconds. How do I fix this?

Kind regards,

Christian Lauer

Update Backtest








Time in backtest is currently set via the datafeed. The events fire in the right order; but the timestamp on the logs will show 930.01.

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.


Hello Jared,

so you're saying that the time of the entries is wrong? But why are there so many of these entries? Does that mean the function is being run before trading hours? And what about the orders submitted after the last day's market close? Can I prevent this somehow?

Kind regards,

Christian Lauer

0

Print the Time value and you will see that it works like it should.

Don't look that much on the logs timestamp. 

probiers mal.

1

Hallo Michael,

ich werde es probieren. What do I have to write in self.Log() to get the time value? And does someone have an idea how I could solve the other problem and stop my Tensec function from ordering after marktet close on the last day of the backtest? Is there something like 'if symbol.IsTradable' which I could use?

Kind regards,

Christian Lauer

0

the documentation in the logging sections says something like: 

self.Debug(str(self.Time) + " Purchasing AAPL: " + str(slice["SPY"].Price))
 
0

Hello Michael,

'self.Time' – that was easy, thank you. I'll make a new thread for the other issue.

Kind regards,

Christian Lauer

0

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