Back

Renko bar from ticks does not work

I can't create renko bars from Ticks, it only works by consolidating Minutes data...
Am I missing something ?

Update Backtest








This is the code I tried:

namespace QuantConnect
{
public class RenkoAlgorithm : QCAlgorithm
{
public override void Initialize()
{
// cash allocation
SetCash(25000);
SetStartDate(2017, 03, 07);
SetEndDate(2017, 03, 08);
AddForex("EURUSD", Resolution.Tick);
var renkoClose = new RenkoConsolidator(0.0001m);
renkoClose.DataConsolidated += (sender, consolidated) =>
{
// call event handler for renko data
HandleRenkoClose(consolidated);
};
SubscriptionManager.AddConsolidator("EURUSD", renkoClose);
}

private void HandleRenkoClose(RenkoBar data)
{
Console.WriteLine("CLOSE - {0} - {1} {2}", data.Time.ToString("o"), data.Open, data.Close);
}

public override void OnData(Slice data)
{
// slice has lots of useful information
//if (!data.ContainsKey("EURUSD")) return;
//Ticks theticks = data.Ticks;
Plot("EURUSD", "Price", data["EURUSD"].Price);
}
}
}
0

We can only consolidate RenkoBar from TradeBar or QuoteBar, since we need bar characteristics (open and close).

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.


Thank you for your reply. In my mind the whole point of priced based bars (range/renko/p&f) is that they are NOT time based...but if quantconnect uses time based underlying bars with open and close to construct them then thay are not truly price bars. As a work around - what is the smallest time interval that I can construct a TradeBar at (1 min, 1 sec, 1 millisecond ?) Thanks.

0

Our tick data is timestamped by the second (all ticks within a second have the same datetime), so you should use second resolution data. 

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.


 hans peter You're right, it's a bug in the RenkoConsolidator, we'll release a fix shortly.

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.


The fix was merged this morning. You should be able to use tick data for Rekno consolidators in your algorithms now.

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.


OK Thank you for a fast response - I will test.

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