Skip to content

Vector Square Root

SQRT calculates the square root of each element in the input array.

Method

tm.ta.sqrt(source)

Inputs

ParameterArgument typeDescriptionDefault Value
sourcepd.SeriesInput data series-

Outputs

OutputType
sqrtnp.ndarray

Example usage

strategy.py
import tradomate as tm
@tm.strategy()
def my_strategy(config: tm.TradomateConfig, data: tm.TradomateData):
# Trying out Vector Square Root
sqrt = tm.ta.sqrt(data.close)
# Get the last value and print
last_value = sqrt.iloc[-1]
tm.log(f"Last value of Vector Square Root is {last_value}")
# Plot the values of sqrt
tm.plot(sqrt, title="Vector Square Root", overlay=False)