Hello Folks,
I would like to run a function on the premise that a condition is met, I feel like this should be relatively simple though I cannot find the syntax in the documentation. I have shown a simple example below, suppose I want to run the rebalance function if and only if the context.market_cap is above some value. How would I incorporate this conditional into the rebalance function?
def filter(context, data):
context.market_cap = '''code here to compute market data for some pre-defined securities'''
def rebalance(context, data):
'''Code/syntax written here'''
return '''some variable stored'''