Back

OnEndOfDayEvent not firing in live trading

The OnEndOfDayEvent works correctly in back testing allowing you to close out your positions at the end of day. In Live Trading this event does not fire 10 minutes before market close as documented. This is problematic when trying to code a day trading strategy. I watched algorithem from 3:50pm EST to 3:58pm EST and it did not close out positions. I had to do it manually on brokerage. Has the functionality of that callback changed since last documented or is this a bug?
Update Backtest








Hey Elliot! Sorry about that we recently sync'd everything on UTC time so it might be a leftover bug. We'll fix this and push some tests for it tonight.

We pretty closely monitor live algorithms to make sure they're successful. I've sent you a few emails to help work through the issued you've had.

OnEndOfDay in QuantConnect uses the trading calendar, so on Christmas Eve it closes at 2pm, etc. 99% of the year closes at 4pm, so you can use if (Time.TimeOfDay.TotalHours > 15.9) to achieve a similar affect while we fix this issue.
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.


Guys, correct me if I am wrong, but my understanding is that EndOfDay event fires midnight. See below a clarification from Jared answering my question about OnData(Slice s) event granularity.
If this is correct EndOfDay will not fire 4pm, so no wander it did not close the position.
Beside this another point: even it fires, the last bar is closed so the tarde will happen OnMarketOpen next day.

Please advice

"
If the algorithm has daily data & minute equity data fill-forward slice triggers at:
> Midnight for daily data
> Minute data 9.30 to 4pm

If the algorithm has equity hourly ff & tick data slice triggers at:
> Hourly 10am-4pm
> Also on each tick
"
0

We use the closing time on the exchange class for each security, if you're using Equities its 4pm, or FX its midnight Sun-Thurs (and 5pm Friday). You can see the security exchange at Securities["IBM"].Exchange

There are two OnEndOfDay events -- one with symbol to specify the security (which triggers by exchange), the other which triggers shortly before midnight.

public void override OnEndOfDay();
public void override OnEndOfDay(string symbol);
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.


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