Sorry if this seems daft, but it's my first go at using QuantConnect.
When I run the attached strategy, the log looks like this:
2014-01-01 00:00:00 Launching analysis for 2ef32a341854ccc1f2531613eee2ab4c with LEAN Engine v2.1.4.3
2014-01-02 10:04:00 Renko 2014-01-02T10:01:00.0000000 - OHLC[177.40, 177.40, 177.35, 177.35] - SMA - 177.46896231875996450295379663
2014-01-02 10:05:00 Renko 2014-01-02T10:03:00.0000000 - OHLC[177.35, 177.35, 177.30, 177.30] - SMA - 177.44482484465139814538896854
2014-01-02 10:06:00 Renko 2014-01-02T10:04:00.0000000 - OHLC[177.30, 177.30, 177.25, 177.25] - SMA - 177.41699272398691269604768732
2014-01-02 10:07:00 Renko 2014-01-02T10:05:00.0000000 - OHLC[177.25, 177.25, 177.20, 177.20] - SMA - 177.38599376341735373946944627
2014-01-02 10:10:00 Renko 2014-01-02T10:06:00.0000000 - OHLC[177.20, 177.25, 177.194293227, 177.25] - SMA - 177.36656608292916034811666823
2014-01-02 10:11:00 Renko 2014-01-02T10:09:00.0000000 - OHLC[177.25, 177.30, 177.25, 177.30] - SMA - 177.35705664251070886981428706
2014-01-02 10:13:00 Renko 2014-01-02T10:10:00.0000000 - OHLC[177.30, 177.35, 177.30, 177.35] - SMA - 177.35604855072346474555510319
2014-01-02 10:14:00 Renko 2014-01-02T10:12:00.0000000 - OHLC[177.35, 177.40, 177.35, 177.40] - SMA - 177.36232732919154121047580273
2014-01-02 10:14:00 BUY >> 177.426260883
2014-01-02 10:22:00 Renko 2014-01-02T10:13:00.0000000 - OHLC[177.40, 177.40, 177.35, 177.35] - SMA - 177.36056628216417818040783091
2014-01-02 10:22:00 SELL >> 177.339273012
2014-01-02 10:23:00 Renko 2014-01-02T10:21:00.0000000 - OHLC[177.35, 177.35, 177.30, 177.30] - SMA - 177.35191395614072415463528364
2014-01-02 10:26:00 Renko 2014-01-02T10:22:00.0000000 - OHLC[177.30, 177.30, 177.25, 177.25] - SMA - 177.33735481954919213254452884
2014-01-02 10:28:00 Renko 2014-01-02T10:25:00.0000000 - OHLC[177.25, 177.30, 177.25, 177.30] - SMA - 177.33201841675645039932388187
2014-01-02 10:32:00 Renko 2014-01-02T10:27:00.0000000 - OHLC[177.30, 177.310277055, 177.25, 177.25] - SMA - 177.32030150007695748513475589
2014-01-02 10:42:00 Renko 2014-01-02T10:31:00.0000000 - OHLC[177.25, 177.30, 177.213623865, 177.30] - SMA - 177.31740128578024927297264791
2014-01-02 10:43:00 Renko 2014-01-02T10:41:00.0000000 - OHLC[177.30, 177.35, 177.30, 177.35] - SMA - 177.32205824495449937683369821
As you can see from the Buy, the buy price is 177.42, but the following Renko Bar has a high of 177.40, so I'm getting filled at what feels like an inconsistent price. But looking at the time of the log versus the time of the Renko bars, they look inconsistent too. I can't tell whether it's a problem with my code, the Renko consolidator, or the Purchasing logic.
Any help understanding this would be greatly appreciated.
Paul Saunders
Paul Saunders
Log(String.Format("Difference between time and end time of bar: {0} - {1} : {2}", data.Time - data.EndTime, data.EndTime, Time));
and ended up with the following output:2014-11-03 09:38:00 Difference between time and end time of bar: 00:00:00 - 11/03/2014 09:30:00 : 11/03/2014 09:38:00 2014-11-03 09:42:00 Difference between time and end time of bar: 00:00:00 - 11/03/2014 09:37:00 : 11/03/2014 09:42:00 2014-11-03 09:53:00 Difference between time and end time of bar: 00:00:00 - 11/03/2014 09:41:00 : 11/03/2014 09:53:00
Obviously the bar times match up, as do the time of the log, and the current contextual time of the algo. but the difference between the contextual time and the end time of the bar (in the 3 log messages above) ranges from 5 minutes to 12 minutes. I'd understand if that was seconds, but not minutes. I think that just might be a bug in QC code somewhere. I'll log it as such.Michael Handschuh
Paul Saunders
Paul Saunders
Michael Handschuh
Log(String.Format("Renko {0} - OHLC[{1}, {2}, {3}, {4}] - SMA - {5}", data.Time.ToString("o"), data.Open, data.High, data.Low, data.Close, _ema.Value));
All consolidators work on an event based system, so they don't actually 'know' what time it is, they just fire events when they decide the data has finished consolidation. For the 'current' time of the algorithm, use the IAlgorithm.Time propertyPaul Saunders
Jared Broad
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.
Michael Handschuh
Paul Saunders
Paul Saunders
Paul Saunders
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!