Back

[charting] how to read/interpret Series.SeriesType.Candle chart raw data?

During backtesting, we can see eType=BacktestResult messages being pushed via ZMQ socket that contains our charting instructions.
One of the default (ie automatically generated) charts is "Strategy Equity".Equity, which has SeriesType of 2, which translates into Candle. This is also consistent with the Equity candle chart we can see in web UI.

Now, what I don't understand, is how the raw output should be interpreted; eg take following:

"Charts": {
"Strategy Equity": {
"Name": "Strategy Equity",
"ChartType": 0, // obsolete field, ignore
"Series": {
"Equity": {
"Name": "Equity",
"Unit": "$",
"Index": 0,
"Values": [
{
"x": 1559336400,
"y": 10000
},
{
"x": 1559361600,
"y": 10000
},
{
"x": 1559509260,
"y": 10000
},
{
"x": 1559509980,
"y": 10000
}...

First we have datapoints that resemble more of a plotting instructions for a line chart. How should candle plot be derived from this input?

Second, why does the timeframe default to 12 minutes - where's that coming from?

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.


Hey Basher,

Those datapoints can be consolidated into candles.
Also, the timeframe we use is your backtesting period divided by 4000. In this case it is 12 minutes.
Rendering more than 4000 bars puts your browser at risk of crashing.

Best
Rahul

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.


> Those datapoints can be consolidated into candles.

How exactly? I must be slow, but i really can't see it, unless the nubmer of data points chnages depending on how fast or if the value is changing. Eg take timestamps of these first 4 datapoints:

┌─[basher@desktop]─[~]
└──╼ + date -d @1552453200
Wed 13 Mar 2019 06:00:00 AM CET
┌─[basher@desktop]─[~]
└──╼ + date -d @1552456800
Wed 13 Mar 2019 07:00:00 AM CET
┌─[basher@desktop]─[~]
└──╼ + date -d @1552460400
Wed 13 Mar 2019 08:00:00 AM CET
┌─[basher@desktop]─[~]
└──╼ + date -d @1552464000
Wed 13 Mar 2019 09:00:00 AM CET

Our value hasn't changed, but we get single datapoint for each hour.
 

0

Disregard the last post, I mixed up datasets.

0

Regardless, using correct data, it's still the same - regardless if we examine this dataset:
 

{
"x": 1559723820,
"y": 10000
},
{
"x": 1559724540,
"y": 10000
},
{
"x": 1559725260,
"y": 9999.89
},
{
"x": 1559725980,
"y": 9999.59
},
{
"x": 1559726700,
"y": 9999.15
}

We can see they're still emitted at a constant interval (12m for me) - how do we consolidate this into OHLC candles?
I guess we could if we were to target longer timeframes than 12m - is this what you're referring to?
 

┌─[basher@desktop]─[~]
└──╼ + date -d @1559723820
Wed 05 Jun 2019 10:37:00 AM CEST
┌─[basher@desktop]─[~]
└──╼ + date -d @1559724540
Wed 05 Jun 2019 10:49:00 AM CEST
┌─[basher@desktop]─[~]
└──╼ + date -d @1559725260
Wed 05 Jun 2019 11:01:00 AM CEST
┌─[basher@desktop]─[~]
└──╼ + date -d @1559725980
Wed 05 Jun 2019 11:13:00 AM CEST
┌─[basher@desktop]─[~]
└──╼ + date -d @1559726700
Wed 05 Jun 2019 11:25:00 AM CEST

 

0

Okay, correct me if I'm wrong, but LEAN is not expected to generate OHLC data, this is responsibility of whoever is consuming the data?
If that is true, then why even define a Candle Series type? It's essentially still line type, that can be consolidated into candles if consumer chooses to do so.

0

> then why even define a Candle Series type
For the consumer to respect the algorithm display wishes. 

Please click follow on this issue if you'd like to be updated when the backtest result objects get candle data. 

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