For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
how to generate quantile number?

Hi guys, I wish to get a quantile number of an indicator, let's say simple moving average. How can I get the number so that I can use it to generate logical operators?
'''
self.sma = bt.indicators.SimpleMovingAverage(
self.datas[0], period=self.params.maperiod)
'''peusdocode below
self.quantile = self.sma.quantileORsomething(0.75)
buy_signal = self.sma > self.quantileCan anyone help? Many thanks!

@fanpeix I'm not quite sure what you mean by getting the quantile of an indicator. A quantile would apply to a series of data values, so you could get the last N values of the indicator and take the quantile of that, like below where I'm using NumPy's
quantile
function.vals = self.sma.get(size=10) quantiles = np.quantile(vals, [0.25, 0.5, 0.75], interpolation='linear')
