Using for stock trading or investment?

This code snippet really inspires me. I often quote stock symbols in my observation notes, and for every symbol I create a markdown file in my Stocks folder like this:

---
symbol: "NASDAQ:AAPL"
---

`="<iframe src=\"https://www.tradingview-widget.com/embed-widget/mini-symbol-overview/?locale=en&colorTheme=dark&symbol=" + this.symbol + "\" width=\"380\" frameborder=\"0\" scrolling=\"no\" allowfullscreen></iframe>"`

What this snippet basically does is to make use of the “Inline Expressions” feature in Dataview plugin, and create an iframe according to the symbol attribute. So

  1. Make sure you have Dataview plugin installed and inline expressions enabled.
  2. Every time you quote another stock (or index/bond/asset/crypto/…), just make a duplicate of this file, change the symbol attribute at the top. Switch to preview mode and - the new file shows an entire new stock. (The file name doesn’t matter, it’s just the symbol attribute that matters.)
  3. If the preview still shows the previous stock, restarting Obsidian usually makes a force refresh of Dataview and thus showing the correct result.
  4. You can append other widgets as well using the same trick.
  5. It works on mobile too! (as long as you’ve fine-tuned the parameters)
7 Likes

Here’s the latest addition to my daily trading note template. I usually get several end-of-day alerts from my charting software (or broker). I would observe these and make a mental note to look into them the next day. Next day arrived, and I’m distracted my a myriad of other things, and I don’t check these alerts.

So I’ve created an Alerts Link, and added a Block Reference to the Alerts in the daily note template. Stocks that have alerts for the past week are automatically front and center in the daily note every day. Like this:

Awesome thread here. Great stuff!

I’m not quite as savvy as you all, but very interested to know what you did to set up the alerts link and block reference in your daily note template to automate that. I get my alerts through Tradingview and I have definitely missed out on a few ideas because of next day distractions.

Fascinating usage! Do you have to manually add a duplicate file of the code snippet to your folder and change the symbol reference, or is there to automate both the duplicate and update the symbol?

The system chart-analyst described looks cool. I’m not a trader but thought I’d suggest the general system I use as a scientist, where my experiments are like your trades.

Three basic categories of notes, designated by tags:

  1. personal - anything that is my own thinking or summary of references
  2. external - any external reference (mostly scientific literature). I cite these notes in my personal notes using links.
  3. experiment - each experiment has its own note. I also cite these notes in personal notes.

I use tags to mark status of experiments (planned, ongoing, analyzing, accomplished).

Experiments have a zettel-like ID and title: for example “exp001_pilot insulin”, “exp002_pilot glucose”, “exp001b_insulin followup”. The ID helps me organize projects in a way that doesn’t require folders and can also expand as much is required (since I don’t know which projects will take off). Maybe you have a trading strategy or type of trade that could be tracked like this?

2 Likes

Hi Keys and sorry for the late reply. For some reason I’m not getting notified of updates on this thread. Need to check my settings on the forum…

Perhaps I didn’t explain my usage of Tradingview Alerts in Obsidian very well. This is how it works: I have most of my Tradingview alerts set to go off at the close (a few are set to go off every minute, but not many). At the close, I will just manually add the EOD alerts I get from TradingView to a note that is a link called Alerts. And in my Daily Trading Note Template, there is a block reference to the Alerts link. You could also just use a link instead of a block reference, but I like the block reference better.

Here’s an example of the Alerts link, showing all the alerts for last week. This is just a note with the title “Alerts”.

date:  2021-08-30
tags: #MarketComments #StockComments #Trades #Entry #Setup #Screen #PnL #Review 
links:[[Portfolio]] [[WatchList]] [[Accounts]] [[RRSPs]] [[ALL]]:
---

---
- 2021-09-03:  **#TSLA** (hi rvol), **#NTLA**, **#OWL**, **#DOCU**, **#SI**, **#CELH**, **#NTNX**

- 2021-09-02:  **#OPEN**, **#ALGN**, **#HSIC**, **#DOCS**, **#VIR** (inside day)

- 2021-09-01:  **#ROKU**, **#NTLA**, **#ALGN**, **#NFLX**

- 2021-08-31:  **#DXCM** (put in an after hours order on this clean breakout), **#TTD**, **#DOCS**, **#FISV** (ANTS retrace entry), **#DOCN** (watch for re-entry), **#SNAP**.  Keep an eye on **#TSP** and **#OWL** also.

- 2021-08-30:   **#TSLA**, **#FISV** (good retrace setup), **#ZI**, **#CELH**, **#U**, **#ROKU**, **#WSM**, **#FATE** (watch this one for early entry), **#DOCU** (on verge of b/o).

And then here is the section of the Daily Trading Note showing the Alerts

---
- EOD #Alerts 
	- ![[Alerts]]
---

So when I turn on my PC, Obsidian starts up with my Daily Trading Note already open, and I can scroll to the Alerts section and see this:

Hope this is helpful.

1 Like

Hey @MiracleXYZ

I can’t get this code snippet to work for some reason on my end. It just shows up blank. I have DV inline enabled and added the symbol to YAML and iframe, but not rendering in preview mode.

Any tips on getting this to work? Using live preview but also didn’t work in Legacy either unfortunately.

Didn’t see this until now @chart_analyst → Thanks for the walkthrough! Incredibly useful tips here

1 Like

Hi @Keys, MiracleXYZ’s code wasn’t working for me either when I first copy pasted it from here. I ended up deleting and rewriting the YAML by hand, then copy-pasting the iframe link underneath. This fixed it for me.

Could you explain how you obtain the code for those iframes? I cant seem to find a good explanation on tradingview’s website. Cheers!

Hi lv3llios,

Would love to, but it has been months since I looked at this, and I flat out can’t recall. I can tell you that the stock TradingView code snippets do not work in Obsidian. I exchanged multiple emails with their developers, and we eventually came up with something that worked. I did find some info on this by searching the web, and between that and working with Tradingview I was able to get it to work.

Fair enough, thank you anyway! I am sure ill be able to figure something out!

I did a quick search and found the youtube video that got me started. Should help some.

OK, my memory has been jogged - after watching that video link above and not succeeding initially, I did the obvious - ask for help here on this forum. This was the key to getting Tradingview widgets to work. Here’s the link:

You absolute legend, cheers for that!

Nice idea.

Does it works in “Editing - Live Preview” mode ?
It seems only working in Read mode

It depends on how you use it. Which investment methodology you adhere to.

I’m closing and delisting this topic.

There is nothing inherently specific about these techniques for stocks. But this topic is a major attraction for spam and link-farming accounts.

Sorry if this inconveniences any legitimate human accounts here. All the techniques and plugins for dealing with data and knowledge management are in other places on this forum.

If you are a legitimate human account, please do not link to trading and financial websites, or your account will be highly suspected of link-farming or spam.

Thanks for understanding.