Easy Python for Stock Trading Charts

Fellow Knimers, I have two questions in regards to the title of this post.

Question 1
I have found quite a few sources to deploy Python for programmatic creation and display of trading stocks’ support and resistance lines. Here are two sources I deemed reliable:
i. Source 1 using k-means
ii. Source 2 using a method I don’t understand but the images look promising still

I am hoping that I can deploy the codes in Knime without Conda, using only the bundled extension available in Knime. I hope someone can help point out if this is possible with either of the two sources.

Question 2
The second question is specific to @mlauber71 who generously helped me out in a previous related post, and this time I’m asking if your YFinance Query workflow here can be modified to be able to use with Knime’s bundled python integration extension :laughing: And if this is possible (hopefully), can it be integrated into the code you provided in the previous post where the dual axes graph was created using Python?

Relevant Notes
The only reason I’m using Python is because of the existence of the integration extension by Knime. It lowers the barrier for non-coders like me to not have to configure the environmental setup.

Many thanks!

Additional Details

  • I’m hoping to process a daily interval graph rather than in minutes. (for Question 1)
  • For Question 2, if my request isn’t possible, that’s fine with me. I have a backup to automate things in a non-Python way for data query.

Hi @badger101,

after a quick look I don’t see obstacles. You can check the packages in the bundled environment in this subsection:
https://docs.knime.com/latest/python_installation_guide/#bundled-env
Your first link states somewhere that

Install the Scikit-Learn package: pip install scikit-learn
Install the Pandas library: pip install pandas
Install the plotly library: pip install plotly
Download the historical data from Github courtesy of Yahoo Finance.

And these three packages are installed in the bundled environment (see above).

As @mlauber71 s YFinance Query workflow: It seems to have some pip dependency on yahooquery (see the infobox in his workflow). The bundled environment does not have that.

Happy developing :slight_smile:

Best regards
Steffen

2 Likes

Hi @steffen_KNIME , I’ve been reading posts on the forum to learn more about using Knime’s python scripts. What I gathered is that even though I have a custom script at hand, I would still need to know how to amend the output and input sections of the data inside the custom code. If it’s not of a big burden to you, would you be kind enough to amend the custom code so that I can use it straight away (in other words, I can produce results in the output port without errors)?

Edit:
And I just realized that, the graph shown in the reference link isn’t the one I wanted, and I would need to use the graph produced by @mlauber71 in the other post. That makes things even harder for me if I were to figure out everything on my own, given my non-coding background.

Hi @badger101,

if you have a script at hand, and it is only amending, could you post it here as a .txt file or so?

Thanks
Steffen

Thanks @steffen_KNIME , here’s the workflow containing all info I think is needed:
My Python.knwf (1.8 MB)

The workflow is in an executed state, but if for some reason you didn’t receive the data, here’s the Excel file containing the data:
forum data hybrid graph.xlsx (160.5 KB)

And here’s the code source in .txt format

code source.txt (7.5 KB)

I hope that I did the right thing, but let me know if you need anything else. Again, thank you for looking into this.

Just to understand, What exactly is the use case of this?
br

1 Like

Thank you to all. I will proceed with the support-horizontal line on my own without the outside code.

Learned a lot from ChatGPT as a non-coder.

It’s funny but helpful.

Consider this thread ‘solved.’

5 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.