Skip to content

Vector Log Natural

LN calculates the natural logarithm of each element in the input array.

Method

tm.ta.ln(source)

Inputs

ParameterArgument typeDescriptionDefault Value
sourcepd.SeriesInput data series-

Outputs

OutputType
lnnp.ndarray

Example usage

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