Highest value over a specified period
MAX calculates the highest value in a given period.
Method
tm.ta.max(source, timeperiod)
Inputs
Parameter | Argument type | Description | Default Value |
---|---|---|---|
source | pd.Series | Input data series | - |
timeperiod | int | Number of periods for the indicator | 30 |
Outputs
Output | Type |
---|---|
max | np.ndarray |
Example usage
import tradomate as tm
@tm.strategy()def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out Highest value over a specified period max = tm.ta.max(data.close, timeperiod=30)
# Get the last value and print last_value = max.iloc[-1] tm.log(f"Last value of Highest value over a specified period is {last_value}")
# Plot the values of max tm.plot(max, title="Highest value over a specified period", overlay=False)