Back

AccessDenied Access Denied when running backtest

I was trying the Tensorflow algo, but when I changed the scheduled (from daily to 10 min)

self.Schedule.On(self.DateRules.EveryDay(self.symbol), 
            self.TimeRules.Every(timedelta(minutes=10)),
            Action(self.Rebalance)) 

and  the update on history from Daily to Minute

self.History([self.symbol,], 1, Resolution.Minute).astype(np.float32)

i get 

<Error>

<Code>AccessDenied</Code>

<Message>Access Denied</Message>

<RequestId>D3CE2BCF0691923C</RequestId>

Update Backtest








From the logs download right? 

For bug reports please send ticket to support@quantconnect.com       

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.


I have this backtest error

 

Failed to initialize algorithm: Initialize(): Python.Runtime.PythonException: NameError : global name 'timedelta' is not defined
at QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.Initialize () [0x00045] in <8ee2db19b5ee483188e2cc7d13311b07>:0

0

Try this a see if it works.

self.TimeRules.Every(TimeSpan.FromMinutes(10))

0

Carlos D 

Case with logs and no access:
I get such an error now and then when backtesting, but pretty rarely. I delete the backtest and re-run, usual the log is accessible on the second try.
 

Issue with “timedelta”:
To use this as shown in the docs I believe you may need to import this functiion from datetime like:
from datetime import timedelta

0

Hi Derek and AutomatedMachine,

Both options worked:

1 Including in python "from datetime import timedelta" to resolve the timedelta 

2. Using self.TimeRules.Every(TimeSpan.FromMinutes(10)) instead of "self.TimeRules.Every(timedelta(minutes=10))

thanks

Carlos

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