Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23305

Stock indicators Quote dont convert to iterable Quotes [closed]

$
0
0

Please help me, I don’t understand and no matter how hard I try to convert, no matter what I do, it turns out the same thing. Problem with Decimal

import pandas as pdfrom itertools import islicefrom stock_indicators import Quote, indicators# load CSV file Quotes to pandas.DataFramedf = pd.read_csv('./quotes.csv', parse_dates=['Time'])# convert to iterable Quotesquotes = [   Quote(date, open, high, low, close, volume)     for date, open, high, low, close, volume     in zip(df['Time'],           df['Open'],            df['High'],            df['Low'],           df['Close'],            df['Volume'], strict=True)]print(quotes)
PS E:\Binance Bot\python> python -u "e:\Binance Bot\python\13.py"Traceback (most recent call last):  File "e:\Binance Bot\python\13.py", line 9, in <module>    quotes = [             ^  File "e:\Binance Bot\python\13.py", line 10, in <listcomp>    Quote(date, open, high, low, close, volume)    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "C:\Users\russt\AppData\Local\Programs\Python\Python311\Lib\site-packages\stock_indicators\indicators\common\quote.py", line 62, in __init__    self.open: Decimal = open if open else 0    ^^^^^^^^^  File "C:\Users\russt\AppData\Local\Programs\Python\Python311\Lib\site-packages\stock_indicators\indicators\common\quote.py", line 25, in _set_open    quote.Open = CsDecimal(value)                 ^^^^^^^^^^^^^^^^  File "C:\Users\russt\AppData\Local\Programs\Python\Python311\Lib\site-packages\stock_indicators\_cstypes\decimal.py", line 21, in __new__    return CsDecimal.Parse(str(decimal))           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^System.FormatException: Input string was not in a correct format.   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)    at System.Decimal.Parse(String s)

I tried converting the data, but to no avail


Viewing all articles
Browse latest Browse all 23305

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>