Does anyone know how to make this Multi Time Frame? I am somewhat familiar with how to do it in reference to price (i.e. input agg = AggregationPeriod.FIFTEEN_MIN ; def close = close(period = agg)
But I don't know how to do it for something like this where it is referencing an internal function - in this case OnBalanceVolume ()
But I don't know how to do it for something like this where it is referencing an internal function - in this case OnBalanceVolume ()
Code:
input longLength = 25;
input shortLength = 13;
input signalLength = 8;
input averageType = AverageType.EXPONENTIAL;
def ZeroLine = 0;
##### OBV #####
def diff_OBV = OnBalanceVolume() - OnBalanceVolume()[1];
def doubleSmoothedAbsDiff_OBV = MovingAverage(averageType, MovingAverage(averageType, AbsValue(diff_OBV), longLength), shortLength);
def TSI_OBV;
def Signal_OBV;
TSI_OBV = if doubleSmoothedAbsDiff_OBV == 0 then 0
else 100 * (MovingAverage(averageType, MovingAverage(averageType, diff_OBV, longLength), shortLength)) / doubleSmoothedAbsDiff_OBV;
Signal_OBV = MovingAverage(averageType, TSI_OBV, signalLength);
Last edited: