Back

Problem acesss with intern loop for

 


the loop i and j always remains blocked at 0 while the loop k increments very well.

// exemple code

public override void OnData(Slice data)
{

for(int i=0;i<=5;i++)
{
for(int j=0;j<=5;j++)
{
for(int k=0;k<=5;k++)
{
Console.WriteLine(i); // check if i run well
Console.WriteLine(j); // check if j run well
Console.WriteLine(k); // check if k run well
}
}
}

}

 

 

 

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.


Hi Aliou,

The console messages are rate-limited. It may just be only printing the messages before the i and j variables are incremented. See the attached backtest for an example which logs the values of i, j, and k. The log file shows the increments work as expected. For more information on logging, view our documentation. Note that there are daily logging limits, so we recommend logging sparsely, focusing on change events rather than logging every time loop. Additionally, we advise the use of `Log` and `Debug` instead of `Console.WriteLine`.

Best,
Derek Melchin

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