Back

Problem about EndOfDay

Hi Quantconnect,
I have try to run example "QCU How Do I Use End of Day Events?" from University.
But we can not Debug anything in :

"public override void OnEndOfDay()
{
Debug(Time.Date.ToShortDateString() + " End of Day Message: ");
}
"
Nothing to print in console with thi Function.
Could you please help me to check it.
Thanks :)
Update Backtest








Fixed, sorry about that. We removed that event and replaced it with a slightly more specific one. There is no "end of day" for all securities since FX and Equities have different close times. To fix this we made it OnEndOfDay(string symbol) which will fire the right end of day for each asset type. E.g.


///
/// End of day event handler: overrides the base class implementation
///

public override void OnEndOfDay(string symbol) {
Console.WriteLine(Time.Date.ToShortDateString() + " End of ALGORITHM Message: " + symbol);
}
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.


Oh, i see. Thank you Jared :)
0

A more question. I can not get data from SetStartDate(2015, 4, 1) to SetEndDate(2015, 5, 1);
I have writed an example to check "data on" and "OnEndOfDay". As i wish a variable will increase and print to console but nothing to happen. It mean didn't received data from (2015, 4, 1) to (2015, 5, 1).
Could you please explain this problem for me.
Thanks.
0

Here is my example :
namespace QuantConnect
{
public class QCU : QCAlgorithm
{
String symbol="GOOGL";
decimal _count_data=0;
decimal _count_day=0;

public override void Initialize()
{
SetStartDate(2015, 4, 1);
SetEndDate(2015, 5, 1);
SetCash(25000);
AddSecurity(SecurityType.Equity, symbol, Resolution.Minute);
}

public void OnData(TradeBars data)
{
Debug("data on :"+_count_data++);
}
public override void OnEndOfDay(string symbol)
{
Debug("End of day: " +_count_day++);
}
}
}
0

Hey there!

The data syncer fell behind a little bit, so some symbols have current data and other don't. You could use an earlier time frame or a symbol like AAPL (it appears the A's are done!).

We're working on a more robust/performant sync mechanism.
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.


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