Thank you for your continuous support.
[Background]
I put the price of the stock in price and use the window function to find the sma as follows
sma8=pd.Series(price).rolling(8).mean().values
sma24 = pd.Series(price).rolling(8).mean().values
[What I want to do]
Write something like a concept.
sma20_std=pd.Series(price).rolling(20).std().values
Zscore=(price-sma20)/sma20_std
As shown in , I would like to calculate the difference between sma and moving average line divided by the standard deviation (for the past 20 pairs).
I'm thinking of creating indicators such as buying and selling Zscore if it's more than a certain number.
Of course, the above is an incorrect code for spouting errors, so I'm looking for an appropriate way to write them, but I haven't been able to reach such a documentation.
Thank you for your cooperation.
I solved myself.
The above code is correct.The error was caused by my careless mistake.
Sorry for the trouble.
© 2024 OneMinuteCode. All rights reserved.