orderbuild fixes; tranche table work; ordershapes still broken
This commit is contained in:
@@ -8,7 +8,6 @@ export let widget = null
|
||||
export let chart = null
|
||||
export let crosshairPoint = null
|
||||
let symbolChangedCbs = [] // callbacks for TV's chart.onSymbolChanged()
|
||||
let lastSymbolChangedArgs = null
|
||||
|
||||
|
||||
const s = useStore()
|
||||
@@ -23,17 +22,22 @@ export function removeSymbolChangedCallback(cb) {
|
||||
}
|
||||
|
||||
function changeSymbol(symbol) {
|
||||
console.log('change symbol', symbol)
|
||||
if (symbol===null)
|
||||
co.selectedSymbol = null
|
||||
else {
|
||||
const info = lookupSymbol(symbol.full_name)
|
||||
lastSymbolChangedArgs = info
|
||||
const info = lookupSymbol(symbol.ticker)
|
||||
symbolChangedCbs.forEach((cb) => cb(info))
|
||||
co.selectedSymbol = info
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export function setSymbol(symbol) {
|
||||
widget.activeChart().setSymbol(symbol.ticker)
|
||||
}
|
||||
|
||||
|
||||
function changeInterval(interval, _timeframe) {
|
||||
co.intervalSecs = intervalToSeconds(interval)
|
||||
DataFeed.intervalChanged(co.intervalSecs)
|
||||
@@ -100,7 +104,14 @@ function initChart() {
|
||||
s.timeZone = tzapi.getTimezone().id
|
||||
// chart.onHoveredSourceChanged().subscribe(null, ()=>console.log('hovered source changed', arguments))
|
||||
// chart.selection().onChanged().subscribe(null, s => console.log('selection', chart.selection().allSources()));
|
||||
changeSymbol(chart.symbolExt())
|
||||
const symbolExt = chart.symbolExt();
|
||||
console.log('symbolExt', symbolExt);
|
||||
if(symbolExt) {
|
||||
changeSymbol(symbolExt)
|
||||
}
|
||||
else {
|
||||
changeSymbol(null)
|
||||
}
|
||||
changeInterval(widget.symbolInterval().interval)
|
||||
co.chartReady = true
|
||||
console.log('chart ready')
|
||||
|
||||
Reference in New Issue
Block a user