Skip to content

Instantly share code, notes, and snippets.

@Fyzu
Created November 20, 2024 15:32
Show Gist options
  • Save Fyzu/42bf2ae5d4c1b09f6dcb565b27f85f53 to your computer and use it in GitHub Desktop.
Save Fyzu/42bf2ae5d4c1b09f6dcb565b27f85f53 to your computer and use it in GitHub Desktop.
dxLink CHART JS API
const dxScriptCodeList = [
```in depth = 10
out sma = sma(close, depth)
```,
```in depth = 10
out sma = sma(open, depth)
```,
```in depth = 10
out sma = sma(high, depth)
```
]
const chart = new DXLinkChart({ indicators: dxScriptCodeList })
chart.addIndicatorsCompileResultsListener((compileResults) => {
// ...
if (compileResults.error) {
// ...
}
})
chart.configure({
subscription: {
symbol: "AAPL{=d}",
fromTime: 0,
},
indicatorsParamaters: [{
depth: 14
}, { some: 4 }]
})
chart.addScriptErrorListener((script, error) => {
})
chart.addCandleSnapshotListener((candles, indicators) => {
// ...
})
chart.addCandleUpdateListener((candles, indicators) => {
// ...
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment