Hi all,

I tried to implement an indicator, which checks the average percentage price change + the standard deviation over the last X days. However, when the indicator tries to update itself, I receive the following runtime error: Cannot implicitly convert type 'Python.Runtime.PyObject' to 'decimal'

class AverageDay(PythonIndicator):
def __init__(self, name, period):
self.Name = name
self.Time = datetime.min
self.Value = {}
self.queue = deque(maxlen=period)

def __repr__(self):
return "{0} -> IsReady: {1}. Time: {2}. Value: {3}".format(self.Name, self.IsReady, self.Time, self.Value)

# Update method is mandatory
def Update(self, input):
r = ((input.Close / input.Open) - 1 ) * 100
count = len(self.queue)
self.Time = input.EndTime
average = sum(self.queue) / count
deviation = std(self.queue)
self.Value["positive"] = average + (2 * deviation)
self.Value["negative"] = average - (2 * deviation)
return count == self.queue.maxlen

Maybe the issue is also that I have the resolution set to Resolution.Daily, while the rest of the algorithm runs on an hourly basis. Also, is there a way to send debug messages from the update function of an indicator?