Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

get_multiple_analysis_with_multiple_intervals #128

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 82 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/python-tradingview-ta.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 24 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from colorama import Fore, Style
from tradingview_ta import TA_Handler, Interval, get_multiple_analysis
from tradingview_ta import TA_Handler, Interval, get_multiple_analysis, get_multiple_analysis_with_multiple_intervals
import tradingview_ta, requests, argparse

arg_parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -152,6 +152,29 @@
except Exception as e:
print("{}#6{} Get indicators test {}failed{}. An exception occured: {}".format(Fore.BLUE, Style.RESET_ALL, Fore.RED, Style.RESET_ALL, e))

try:
analysis = get_multiple_analysis_with_multiple_intervals(screener="crypto",
intervals=[Interval.INTERVAL_1_DAY,
Interval.INTERVAL_1_HOUR],
symbols=["BINANCE:SOLUSDT", "BINANCE:BTCUSDT"])
for key, value in analysis.items():
print(
"{}#7{} Please compare with {}https://www.tradingview.com/symbols/{}/technicals/{}. (Switch to 1 hour tab)".format(
Fore.BLUE, Style.RESET_ALL, Fore.LIGHTMAGENTA_EX, key, Style.RESET_ALL))
print("{}#7{} (Summary) Rec: {}, Sell: {}, Neutral: {}, Buy: {}".format(Fore.BLUE, Style.RESET_ALL,
value.summary["RECOMMENDATION"],
value.summary["SELL"],
value.summary["NEUTRAL"],
value.summary["BUY"]))
if input("{}#7{} Are the results the same? (Y/N) ".format(Fore.BLUE, Style.RESET_ALL)).lower() == "y":
print("{}#7{} Multiple analysis test {}success{}.".format(Fore.BLUE, Style.RESET_ALL, Fore.GREEN,
Style.RESET_ALL))
success += 1
else:
print("{}#7{} Multiple analysis test {}failed{}".format(Fore.BLUE, Style.RESET_ALL, Fore.RED, Style.RESET_ALL))
except Exception as e:
print("{}#7{} Multiple analysis test {}failed{}. An exception occured: {}".format(Fore.BLUE, Style.RESET_ALL,
Fore.RED, Style.RESET_ALL, e))

print("------------------------------------------------")
print("Test finished. Result: {}{}/{}{}.".format(Fore.LIGHTWHITE_EX, success, COUNT, Style.RESET_ALL))
3 changes: 2 additions & 1 deletion tradingview_ta/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .main import TA_Handler, TradingView, Analysis, Interval, Exchange, get_multiple_analysis, __version__
from .main import TA_Handler, TradingView, Analysis, Interval, Exchange, get_multiple_analysis, \
get_multiple_analysis_with_multiple_intervals, __version__
from .technicals import Recommendation, Compute
Loading