Back

Help to get rid of 0s

This code which should in theory filter 0s:


if(_data._sd > 0)
{
_data._q = (_data._sd);
} else
{
_data._q = 1;
}
Plot("Indicator "+_data.Symbol, "w", _data._q);


produces problems, and I don't have an idea how to get rid of it:

Update Backtest








Hey @Tadas, just by looking at it I'd say you're right, in theory it should work, but without an example I can run to reproduce the bug it's hard for me to figure out what may be happening here.

If you can, define a simplified project that shows the behaviors and share or send me the project id and I can take a peek.

Just some thoughts, what's the range on that plot? Are we looking at values in the range of 0 to 100 or more like 0 to 1?

If the expected values are never intended to be less than 1 (the default set when 0 is encountered) maybe the usage of Math.Max( a, b ) would be useful here._data._q = Math.Max(1, _data._sd);
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.


Right, seems I've should added this algo right away. Here it is. Probably the real question, why indicator has "empty" values, didn't seen this before.
0


Sorry to say that's not the indicators.. there's a 6mo hole in the data for some of those unpopular symbols. The indicator goes to 0 because of the long data gap.

We're doing a broader review of our whole FX data set, and thinking of replacing it with a brand new one.. so hang tight for now we'll have a new much broader set soon enough.
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.


@Jared, you mean some of the symbols inluence major pairs behavior? Because I see those 0s in GBPUSD as well.

2) OK, as a quick fix, tried to remove symbols without data, found another thing. Clone above algo, remove "GBPUSD" and you'll see algo stops working without any errors:
0


Hey Tadas, it looks like the bars.Count != symbols.Count condition is preventing anything from happening. This is because we are actually adding GBPUSD under the hood for the conversion rates to support portfolio value calculations for the EURGBP pair. When run, bars.Count is 10 and symbols.Count is 9, so you actually are getting extra data. This is a bug, we call it an 'internal feed' and it's not supposed to make it into your algorithm.

I've submitted a fix now.
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.


Thank you, Michael, related issue also fixed. For anyone interested attaching final. Interesting, changing SMA from default strategy values (20, 120) drops profits significantly.
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