-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid Option Error and General Function Failures in pyquotex Library #32
Comments
I need to see the code you are running. |
*Subject*: Issue with get_realtime_candles Function in pyquotex Library
*Description*: I am encountering issues with the get_realtime_candles
function in the pyquotex library. The function, as well as other functions,
are not working as expected and result in errors. Specifically, I get an
"invalid option" error and a TypeError.
*Steps to Reproduce*:
1. Set up a Python environment with pyquotex version 1.0.0.
2. Execute the following script:
python
Copy code
import asyncioimport numpy as npimport talib
async def analyze_candles(client):
check_connect, message = await client.connect()
if check_connect:
asset = "EURUSD_otc"
list_size = 100
client.start_candles_stream(asset, 60)
while True:
prices = client.get_realtime_candles(asset)
if len(prices[asset]) >= list_size:
candles = prices[asset]
open_prices = np.array([float(candle['open']) for
candle in candles])
high_prices = np.array([float(candle['high']) for
candle in candles])
low_prices = np.array([float(candle['low']) for candle
in candles])
close_prices = np.array([float(candle['close']) for
candle in candles])
doji = talib.CDLDOJI(open_prices, high_prices,
low_prices, close_prices)
hammer = talib.CDLHAMMER(open_prices, high_prices,
low_prices, close_prices)
engulfing = talib.CDLENGULFING(open_prices,
high_prices, low_prices, close_prices)
spinning_top = talib.CDLSPINNINGTOP(open_prices,
high_prices, low_prices, close_prices)
tristar = talib.CDLTRISTAR(open_prices, high_prices,
low_prices, close_prices)
print("CDLDOJI:", doji)
print("CDLHAMMER:", hammer)
print("CDLENGULFING:", engulfing)
print("CDLSPINNINGTOP:", spinning_top)
print("CDLTRISTAR:", tristar)
if any(doji != 0):
print("Doji pattern detected, considering a trade...")
break
await asyncio.sleep(5)
print("Saindo...")
client.close()
async def main():
client = YourClientClass() # Replace with actual client initialization
await analyze_candles(client)
if __name__ == "__main__":
asyncio.run(main())
*Observed Issues*:
- *Invalid Option Error*: "Opção inválida. Use 'help' para obter a lista
de opções."
- *TypeError*: TypeError: get_candles() missing 1 required positional
argument: 'client'
*Error Messages*:
css
Copy code
TypeError: get_candles() missing 1 required positional argument: 'client'
*Environment*:
- Python Version: 3.12
- pyquotex Version: 1.0.0
- Operating System: Windows 10
*Expected Behavior*: The script should run without errors, connect to the
client, stream real-time candlesticks, analyze them with TA-Lib, and print
the results.
*Actual Behavior*: The script fails with an "invalid option" error and a
TypeError. Functions are not working as expected.
…On Tue, Sep 17, 2024 at 4:38 PM Cleiton Leonel Creton < ***@***.***> wrote:
I am encountering issues with the pyquotex library, specifically when
trying to execute the get_candles function. The main issue is an "invalid
option" error, and none of the script functions, including get_candles, are
working as expected. The issue affects all script functions.
Steps to Reproduce Setup Environment:
Installed pyquotex version 1.0.0 using pip. Created and activated a
virtual environment. Run Script:
Executed the script with the following command: bash Copy code python
app.py Observed Issue:
Error message displayed: vbnet Copy code Opção inválida. Use 'help' para
obter a lista de opções. Running the get_candles function results in
errors. Environment Library Version: 1.0.0 Python Version: 3.12 Operating
System: Windows 10 Expected Behavior The script should run without any
"invalid option" errors. The get_candles function should execute
successfully and print the candlestick data. Actual Behavior The script
fails with an "invalid option" error. Running the get_candles function
leads to errors such as: arduino Copy code Traceback (most recent call
last): File "C:\Users\hp\OneDrive\Desktop\project 2\pyquotex\app.py", line
548, in loop.run_until_complete(main()) File "C:\Program
Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py",
line 687, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File
"C:\Users\hp\OneDrive\Desktop\project 2\pyquotex\app.py", line 542, in main
await execute(option) File "C:\Users\hp\OneDrive\Desktop\project
2\pyquotex\app.py", line 524, in execute return await get_candles()
^^^^^^^^^^^^^ TypeError: get_candles() missing 1 required positional
argument: 'client' Additional Information I have reviewed the documentation
and examples provided but could not resolve the issue. I attempted various
functions and commands, all leading to similar errors. Request for
Assistance Could you please assist with the following:
Invalid Option Error: Guidance on resolving the "invalid option" error and
ensuring the correct command options are used. Function Failures:
Clarification on common issues and troubleshooting steps for the
get_candles function that fails to execute correctly. Thank you for your
assistance and support.
I need to see the code you are running.
—
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJVVEA5UFVPRLSHKDJB5UI3ZXAESDAVCNFSM6AAAAABOKFDOM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJVGM3DENBZGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Please edit your comment and leave it formatted correctly to better understand what is happening. |
I am encountering issues with the pyquotex library, specifically when trying to execute the get_candles function. The main issue is an "invalid option" error, and none of the script functions, including get_candles, are working as expected. The issue affects all script functions.
Steps to Reproduce
Setup Environment:
Installed pyquotex version 1.0.0 using pip.
Created and activated a virtual environment.
Run Script:
Executed the script with the following command:
bash
Copy code
python app.py
Observed Issue:
Error message displayed:
vbnet
Copy code
Opção inválida. Use 'help' para obter a lista de opções.
Running the get_candles function results in errors.
Environment
Library Version: 1.0.0
Python Version: 3.12
Operating System: Windows 10
Expected Behavior
The script should run without any "invalid option" errors.
The get_candles function should execute successfully and print the candlestick data.
Actual Behavior
The script fails with an "invalid option" error.
Running the get_candles function leads to errors such as:
arduino
Copy code
Traceback (most recent call last):
File "C:\Users\hp\OneDrive\Desktop\project 2\pyquotex\app.py", line 548, in
loop.run_until_complete(main())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1776.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\hp\OneDrive\Desktop\project 2\pyquotex\app.py", line 542, in main
await execute(option)
File "C:\Users\hp\OneDrive\Desktop\project 2\pyquotex\app.py", line 524, in execute
return await get_candles()
^^^^^^^^^^^^^
TypeError: get_candles() missing 1 required positional argument: 'client'
Additional Information
I have reviewed the documentation and examples provided but could not resolve the issue.
I attempted various functions and commands, all leading to similar errors.
Request for Assistance
Could you please assist with the following:
Invalid Option Error: Guidance on resolving the "invalid option" error and ensuring the correct command options are used.
Function Failures: Clarification on common issues and troubleshooting steps for the get_candles function that fails to execute correctly.
Thank you for your assistance and support.
The text was updated successfully, but these errors were encountered: