Back

OnOrderEvent doesn't log when a ticket is updated?

In one of the examples 

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/OrderTicketDemoAlgorithm.py

It doesn't appear that when a ticket limit price is updated that this gets logged. Is there anyway to get a log message for updated tickets?

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,

Can you please elaborate on exactly what you're expecting and what part of the code should be delivering it? From what I can see, it looks like that example contains the necessary logs to produce the kind of logs you want.

0

Hello,

Below is the log when I ran the example algorithm. From my end, I can see the logged information about updated limits. The updated tickets will still have the same OrderID with a different limit price. 

2013-10-07 12:00:00 : Submitting LimitOrder
2013-10-07 12:00:00 : 2013-10-07 12:00:00: 1: Time: 10/7/2013 4:00:00 PM OrderID: 3 Symbol: SPY Status: Submitted
2013-10-07 12:00:00 : 2013-10-07 12:00:00: 1: Time: 10/7/2013 4:00:00 PM OrderID: 4 Symbol: SPY Status: Submitted
2013-10-07 12:00:00 : Updating limits - Long: 149.93 Short: 150.21
2013-10-07 12:00:00 : 2013-10-07 12:00:00: 1: Time: 10/7/2013 4:00:00 PM OrderID: 3 Symbol: SPY Status: Submitted
2013-10-07 12:00:00 : 2013-10-07 12:00:00: 1: Time: 10/7/2013 4:00:00 PM OrderID: 4 Symbol: SPY Status: Submitted
2013-10-07 12:01:00 : Updating limits - Long: 149.94 Short: 150.20
2013-10-07 12:01:00 : 2013-10-07 12:01:00: 1: Time: 10/7/2013 4:01:00 PM OrderID: 3 Symbol: SPY Status: Submitted
2013-10-07 12:01:00 : 2013-10-07 12:01:00: 1: Time: 10/7/2013 4:01:00 PM OrderID: 4 Symbol: SPY Status: Submitted
2013-10-07 12:02:00 : Updating limits - Long: 149.95 Short: 150.19
2013-10-07 12:02:00 : 2013-10-07 12:02:00: 1: Time: 10/7/2013 4:02:00 PM OrderID: 3 Symbol: SPY Status: Submitted
2013-10-07 12:02:00 : 2013-10-07 12:02:00: 1: Time: 10/7/2013 4:02:00 PM OrderID: 4 Symbol: SPY Status: Submitted
2013-10-07 12:03:00 : Updating limits - Long: 149.96 Short: 150.18
2013-10-07 12:03:00 : 2013-10-07 12:03:00: 1: Time: 10/7/2013 4:03:00 PM OrderID: 3 Symbol: SPY Status: Submitted
2013-10-07 12:03:00 : 2013-10-07 12:03:00: 1: Time: 10/7/2013 4:03:00 PM OrderID: 4 Symbol: SPY Status: Submitted
2013-10-07 12:04:00 : Updating limits - Long: 149.97 Short: 150.17
2013-10-07 12:04:00 : 2013-10-07 12:04:00: 1: Time: 10/7/2013 4:04:00 PM OrderID: 3 Symbol: SPY Status: Submitted
2013-10-07 12:04:00 : 2013-10-07 12:04:00: 1: Time: 10/7/2013 4:04:00 PM OrderID: 4 Symbol: SPY Status: Submitted
2013-10-07 12:05:00 : Updating limits - Long: 149.98 Short: 150.16
2013-10-07 12:05:00 : 2013-10-07 12:05:00: 1: Time: 10/7/2013 4:05:00 PM OrderID: 3 Symbol: SPY Status: Submitted
2013-10-07 12:05:00 : 2013-10-07 12:05:00: 1: Time: 10/7/2013 4:05:00 PM OrderID: 3 Symbol: SPY Status: Filled Quantity: 10 FillPrice: 149.9792 USD OrderFee: 1 USD
2013-10-07 12:05:00 : 2013-10-07 12:05:00: 1: Time: 10/7/2013 4:05:00 PM OrderID: 4 Symbol: SPY Status: Submitted
2013-10-07 12:06:00 : 1: Cancelling short order, long order is filled.
2013-10-07 12:06:00 : 2013-10-07 12:06:00: 1: Time: 10/7/2013 4:06:00 PM OrderID: 4 Symbol: SPY Status: CancelPending
2013-10-07 12:06:00 : 2013-10-07 12:06:00: 1: Time: 10/7/2013 4:06:00 PM OrderID: 4 Symbol: SPY Status: Canceled

 

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.


So yes, in that code it logs the price change but the user has to do it manually. 

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/OrderTicketDemoAlgorithm.py#L137

Whereas I would have expected limit price changes to be logged automatically using the following code

https://github.com/QuantConnect/Lean/blob/master/Algorithm.Python/OrderTicketDemoAlgorithm.py#L332-L334

 

0

Order events "[signify] a change in an order state". Changing the limit prices of an order is not a change to this state - the order is still live and has not been filled/removed.

1

ok, good point. Yeh I was just curious it seemed slightly counter intuitive but I see now!

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