Error message for calling KAMA indicator in Python

Author: xaifer48, Created: 2021-11-19 23:17:10, Updated: 2021-11-20 09:10:32

import talib def main (: LastBarTime is equal to 0. while ((true): records = exchange.GetRecords BarTime = records[-1][Time] ext.PlotRecords ((records, " ") if LastBarTime!= BarTime: This is the last bartime. KAMA (records, 30) Log ((kama[30]) Log ((kama[kama.length-1]) LastBarTime is the bartime. I tried the KAMA indicator, it works with JS, and it works with py, which returns the error line 9, in main TypeError: Argument real has incorrect type (expected numpy.ndarray, got OOO00) .

In addition, I wrote the implementation code for the KAMA indicator by definition: Direction ((DIR) = closing price - closing price before n days Volatility rate ((VIR) = sum ((abs ((closing price - closing price of the previous trading day), n) Efficiency (ER) = direction / rate of fluctuation So fast is equal to 2 over (n1 + 1) Slowing is equal to 2 / (n2 + 1) Smoothness (CS) = efficiency * (fast - slow) + slow Coefficient (CQ) = smooth * smooth KAMA = index-weighted average (Dynamic Moving Average (Closing Price, Coefficient), 2) (This last step has an introduction in which it is calculated in this way: current KAMA = previous KAMA + SC x (Price - previous KAMA)

I've been searching for a long time and I can't see where the first KAMA came from in the last step, when calculating the first KAMA value, is there no previous KAMA value? Please tell me what to do.


More

The Little DreamI'm going to go to the gym and I'm going to go to the gym. There are examples of Python calls in the FMZ API documentation. /upload/asset/16abd34635f22397a31c.png This is a list of all the different ways Abd34635f22397a31c.png is credited in the database.

xaifer48Thank you.

The Little DreamYou can set the parameters that the data structure requires for the function.

xaifer48Can you tell me if this input parameter is also an array? If I define an array as a parameter, can I also compute KAMA? Why is it written as records.Close, without a subheading? For example records[i].Close.