Skip to content

CL-2954: Update datafeed tutorial#156

Merged
danielg-tv merged 3 commits into
masterfrom
CL-2954-update-datafeed-tutorial
Jun 10, 2026
Merged

CL-2954: Update datafeed tutorial#156
danielg-tv merged 3 commits into
masterfrom
CL-2954-update-datafeed-tutorial

Conversation

@anachuprina

Copy link
Copy Markdown
Contributor

No description provided.

@anachuprina anachuprina requested a review from SlicedSilver May 22, 2026 14:14

@SimonMorda SimonMorda left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comment as Simon instead of Romain but didn't want to switch user and restart again.

Comment thread README.md
@@ -0,0 +1,236 @@
import {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im aware you've explained in other md files the purpose of this file but could you at least add an intro at the very top of the file to quickly indicate what's that file for while inviting people to read the README & INTEGRATION files?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a short description/header

Comment thread scripts/sync-tradingview-assets.mjs
Comment thread src/trading.js Outdated
Comment on lines +178 to +181
const alertIndex = activeAlerts.findIndex(
alert => alert.id === id
);
if (alertIndex === -1) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though the setTimeout is very small I would move this block down into it. activeAlerts may be different between now and within the setTimeout resulting in out of date data.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used codex and moved the alert lookup inside the timeout and now resolve by id against the latest activeAlerts state before updating.

Comment thread src/trading.js Outdated
Comment thread src/trading.js Outdated
const price = lastPlusClickPrice;
const alertAction = actionsFactory.createAction({
actionId: 'create_custom_alert',
label: `Add Alert at ${price.toFixed(2)}`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible refinement to bring here at some point.
Depending on the formater used/precision set in Settings, toFixed may be wrong.
Not the end of the world though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex replaced toFixed with helped function that falls back to toFixed. I think this helped is not working so it will always fall back to toFixed(). I will look into it more in the future

Comment thread src/datafeed/helpers.js Outdated
@SimonMorda

Copy link
Copy Markdown

Really good tutorial!

I think some tweaks could be brought to centralize some common logic, especially when it comes to creating and managing web socket creation.
Let's keep that in mind for a future refinement.

@SimonMorda

Copy link
Copy Markdown

@illetid , @SlicedSilver could you also please provide your feedback? 🙏

@@ -0,0 +1,323 @@
// Downloads private TradingView GitHub packages into vendor/tradingview and

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[minor] we can try to use the library as a dependency in package.json and then we need just one manual step to copy the library files to the public folder in post-install. https://www.tradingview.com/charting-library-docs/latest/quick-start/#2-install-the-library

But it's really up to you

@illetid illetid Jun 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked and we don't have any bundler, so it will require a lot of additional setup. please ignore the comment above

@danielg-tv

Copy link
Copy Markdown
Contributor

QA tested it and it's moved to deploy column https://tradingview-air.atlassian.net/browse/CL-2954
Maybe I can merge the pull request? Or are we waiting for another pair of eyes? @romfrancois

@romfrancois

Copy link
Copy Markdown
Contributor

QA tested it and it's moved to deploy column https://tradingview-air.atlassian.net/browse/CL-2954 Maybe I can merge the pull request? Or are we waiting for another pair of eyes? @romfrancois

You can merge it ✅

@danielg-tv danielg-tv merged commit 6213adf into master Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants