i'm trying to define this:

 

def GetCurrentTrend(self, ticker = "SPY", span = 30, resolution = Resolution.Daily, noisy = False):

but when i call it produces this error in the backtest at the line where it is called:

OnData: name 'GetCurrentTrend' is not defined

i've seen user-defined functions work if they're scheduled, but can you all confirm whether it's possible to call a user-defined function from within another function? thx

Author