[docs]defset_moving_average_types(self,moving_average_ma:int,moving_average_atr:int):"""Sets the types of moving averages for the Pretty Good Oscillator. Args: moving_average_ma (int): The type of the Moving Average (MA). moving_average_atr (int): The type of the Average True Range (ATR). Raises: ValueError: Raised if the moving average type is not between 0 and 9. """ifmoving_average_mainrange(10)andmoving_average_atrinrange(10):self.instance.send(self.id,'setMovingAverageTypesPrettyGood',{'movingAverageMA':moving_average_ma,'movingAverageATR':moving_average_atr,},)else:raiseValueError('Invalid moving average type. Must be an integer between 0 and 9.')returnself
[docs]defset_period_counts(self,period_count_ma:int,period_count_atr:int):"""Sets the period counts for the MA and ATR in the Pretty Good Oscillator. Args: period_count_ma (int): The period count for the Moving Average (MA). period_count_atr (int): The period count for the Average True Range (ATR). Raises: ValueError: Raised if the period count is not greater than zero. """ifperiod_count_ma>0andperiod_count_atr>0:self.instance.send(self.id,'setPeriodCountsPrettyGood',{'periodCountMA':period_count_ma,'periodCountATR':period_count_atr},)else:raiseValueError('Period count should be an integer larger than zero.')returnself