Back

OnOrderEvent timing

Hi

I notice in backtests that OnOrderEvent is triggered at a resolution the same as the data resolution. For example, with hourly data, order events are triggered only on whole numbers of hours. Is this true in live trading?

For example, my algorithm uses hourly data for set-ups and places a StopMarketOrder to enter. In OnOrderEvent I would set a stop-loss order (another StopMarketOrder) to be executed as soon as the entry StopMarketOrder is filled. Will OnOrderEvent execute as soon as the entry StopMarketOrder is filled, or will it wait until the next hourly data is provided?

Cheers

Tony

 

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

In live trading, the data resolution would be ticker level. So we recommend you use minute/ticker level of data resolution in backtest to better match the situation in live trading.

For your second question, the OnOrderEvent will execute after the OnData is finished. Thank you!

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 Daniel

Thanks for your explanation. I'll have to go with market orders so I can have a stop-loss order in place immediately.

Cheers

Tony

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