<html>
<head>
<title>TradingView Charting Library demo</title>
<!-- Fix for iOS Safari zooming bug -->
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
<script type="text/javascript" src="https://charting-library.tradingview-widget.com/charting_library/charting_library.standalone.js"></script>
<script type="text/javascript" src="https://charting-library.tradingview-widget.com/datafeeds/udf/dist/bundle.js"></script>
</head>
<body style="margin:0px;">
<div id="tv_chart_container"></div>
</body>
</html>
<html>
<head>
<title>TradingView Charting Library demo</title>
<!-- Fix for iOS Safari zooming bug -->
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
<script type="text/javascript" src="https://charting-library.tradingview-widget.com/charting_library/charting_library.standalone.js"></script>
<script type="text/javascript" src="https://charting-library.tradingview-widget.com/datafeeds/udf/dist/bundle.js"></script>
</head>
<body style="margin:0px;">
<div id="tv_chart_container"></div>
</body>
</html>
xxxxxxxxxx
const useApplyOverrides = true;
const useLoad = true;
const useSavedData = true;
const useSettingsOverrides = true;
const useSettingsAdapter = true;
const useLocalStorage = true;
const useOverrides = true;
const colors = {
applyOverrides: "rgba(255, 125, 0, 1)", // orange
widgetLoad: "rgba(0, 0, 255, 1)", // blue
saved_data: "rgba(255, 0, 0, 1)", // red
settingsOverrides: "rgba(255, 0, 255, 1)", // purple
initialSettings: "rgba(0, 255, 0, 1)", // green
localStorage: "rgba(0,0,0,1)", // black
overrides: "rgba(255, 255, 0, 1)" // yellow
};
const baseStyleString = `{"style":1,"esdShowDividends":true,"esdShowSplits":true,"esdShowEarnings":true,"esdShowBreaks":false,"esdFlagSize":2,"showContinuousContractSwitches":true,"showContinuousContractSwitchesBreaks":false,"showFuturesContractExpiration":true,"showLastNews":true,"showCountdown":false,"bidAsk":{"visible":false,"lineStyle":1,"lineWidth":1,"bidLineColor":"#2962FF","askLineColor":"#F7525F"},"prePostMarket":{"visible":true,"lineStyle":1,"lineWidth":1,"preMarketColor":"#FB8C00","postMarketColor":"#2962FF"},"highLowAvgPrice":{"highLowPriceLinesVisible":false,"highLowPriceLabelsVisible":false,"averageClosePriceLineVisible":false,"averageClosePriceLabelVisible":false,"highLowPriceLinesColor":"","highLowPriceLinesWidth":1,"averagePriceLineColor":"","averagePriceLineWidth":1},"showPriceLine":true,"priceLineWidth":1,"priceLineColor":"","baseLineColor":"#B2B5BE","showPrevClosePriceLine":false,"prevClosePriceLineWidth":1,"prevClosePriceLineColor":"#555555","dividendsAdjustment":{},"backAdjustment":false,"settlementAsClose":true,"sessionId":"regular","sessVis":false,"statusViewStyle":{"fontSize":16,"showExchange":true,"showInterval":true,"symbolTextSource":"description"},"candleStyle":{"upColor":"rgba(0, 0, 0, 1)","downColor":"rgba(0, 0, 0, 1)","drawWick":true,"drawBorder":true,"borderColor":"#378658","borderUpColor":"#089981","borderDownColor":"#F23645","wickColor":"#737375","wickUpColor":"#089981","wickDownColor":"#F23645","barColorsOnPrevClose":false,"drawBody":true},"hollowCandleStyle":{"upColor":"#089981","downColor":"#F23645","drawWick":true,"drawBorder":true,"borderColor":"#378658","borderUpColor":"#089981","borderDownColor":"#F23645","wickColor":"#737375","wickUpColor":"#089981","wickDownColor":"#F23645","drawBody":true},"haStyle":{"upColor":"#089981","downColor":"#F23645","drawWick":true,"drawBorder":true,"borderColor":"#378658","borderUpColor":"#089981","borderDownColor":"#F23645","wickColor":"#737375","wickUpColor":"#089981","wickDownColor":"#F23645","showRealLastPrice":false,"barColorsOnPrevClose":false,"inputs":{},"inputInfo":{},"drawBody":true},"barStyle":{"upColor":"#089981","downColor":"#F23645","barColorsOnPrevClose":false,"dontDrawOpen":false,"thinBars":true},"hiloStyle":{"color":"#2962FF","showBorders":true,"borderColor":"#2962FF","showLabels":true,"labelColor":"#2962FF","drawBody":true},"columnStyle":{"upColor":"rgba(8, 153, 129, 0.5)","downColor":"rgba(242, 54, 69, 0.5)","barColorsOnPrevClose":true,"priceSource":"close"},"lineStyle":{"color":"#2962FF","linestyle":0,"linewidth":2,"priceSource":"close","styleType":2},"areaStyle":{"color1":"rgba(41, 98, 255, 0.28)","color2":"#2962FF","linecolor":"#2962FF","linestyle":0,"linewidth":2,"priceSource":"close","transparency":100},"renkoStyle":{"upColor":"#089981","downColor":"#F23645","borderUpColor":"#089981","borderDownColor":"#F23645","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","borderUpColorProjection":"#a9dcc3","borderDownColorProjection":"#f5a6ae","wickUpColor":"#089981","wickDownColor":"#F23645","inputs":{"source":"close","sources":"Close","boxSize":3,"style":"ATR","atrLength":14,"wicks":true},"inputInfo":{"source":{"name":"Source"},"sources":{"name":"Source"},"boxSize":{"name":"Box size"},"style":{"name":"Style"},"atrLength":{"name":"ATR length"},"wicks":{"name":"Wicks"}}},"pbStyle":{"upColor":"#089981","downColor":"#F23645","borderUpColor":"#089981","borderDownColor":"#F23645","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","borderUpColorProjection":"#a9dcc3","borderDownColorProjection":"#f5a6ae","inputs":{"source":"close","lb":3},"inputInfo":{"source":{"name":"Source"},"lb":{"name":"Number of line"}}},"kagiStyle":{"upColor":"#089981","downColor":"#F23645","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","inputs":{"source":"close","style":"ATR","atrLength":14,"reversalAmount":1},"inputInfo":{"source":{"name":"Source"},"style":{"name":"Style"},"atrLength":{"name":"ATR length"},"reversalAmount":{"name":"Reversal amount"}}},"pnfStyle":{"upColor":"#089981","downColor":"#F23645","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","inputs":{"sources":"Close","reversalAmount":3,"boxSize":1,"style":"ATR","atrLength":14,"oneStepBackBuilding":false},"inputInfo":{"sources":{"name":"Source"},"boxSize":{"name":"Box size"},"reversalAmount":{"name":"Reversal amount"},"style":{"name":"Style"},"atrLength":{"name":"ATR length"},"oneStepBackBuilding":{"name":"One step back building"}}},"baselineStyle":{"baselineColor":"#758696","topFillColor1":"rgba(8, 153, 129, 0.28)","topFillColor2":"rgba(8, 153, 129, 0.05)","bottomFillColor1":"rgba(242, 54, 69, 0.05)","bottomFillColor2":"rgba(242, 54, 69, 0.28)","topLineColor":"#089981","bottomLineColor":"#F23645","topLineWidth":2,"bottomLineWidth":2,"priceSource":"close","transparency":50,"baseLevelPercentage":50},"rangeStyle":{"upColor":"#089981","downColor":"#F23645","thinBars":true,"upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","inputs":{"range":10,"phantomBars":false},"inputInfo":{"range":{"name":"Range"},"phantomBars":{"name":"Phantom bars"}}},"symbol":"NASDAQNM:AAPL","shortName":"AAPL","timeframe":"","onWidget":false,"interval":"1D","unitId":null,"priceAxisProperties":{"autoScale":true,"alignLabels":true}}`;
const localStorageStyle = JSON.parse(baseStyleString);
localStorageStyle.candleStyle.upColor = colors.localStorage;
localStorageStyle.candleStyle.downColor = colors.localStorage;
localStorage.removeItem("tradingview.chartproperties.mainSeriesProperties");
if (useLocalStorage) {
localStorage.setItem(
"tradingview.chartproperties.mainSeriesProperties",
JSON.stringify(localStorageStyle)
);
}
const initialSettingsStyle = JSON.parse(baseStyleString);
initialSettingsStyle.candleStyle.upColor = colors.initialSettings;
initialSettingsStyle.candleStyle.downColor = colors.initialSettings;
const savedChartDataString = `{"layout":"s","charts":[{"panes":[{"sources":[{"type":"MainSeries","id":"_seriesId","zorder":0,"haStyle":{"studyId":"BarSetHeikenAshi@tv-basicstudies-60"},"renkoStyle":{"studyId":"BarSetRenko@tv-prostudies-64"},"pbStyle":{"studyId":"BarSetPriceBreak@tv-prostudies-34"},"kagiStyle":{"studyId":"BarSetKagi@tv-prostudies-34"},"pnfStyle":{"studyId":"BarSetPnF@tv-prostudies-34"},"rangeStyle":{"studyId":"BarSetRange@tv-basicstudies-72"},"formattingDeps":{"format":"price","pricescale":100,"minmov":1,"minmove2":0},"state":{"style":1,"esdShowDividends":true,"esdShowSplits":true,"esdShowEarnings":true,"esdShowBreaks":false,"esdFlagSize":2,"showContinuousContractSwitches":true,"showContinuousContractSwitchesBreaks":false,"showFuturesContractExpiration":true,"showLastNews":true,"showCountdown":false,"bidAsk":{"visible":false,"lineStyle":1,"lineWidth":1,"bidLineColor":"#2962FF","askLineColor":"#F7525F"},"prePostMarket":{"visible":true,"lineStyle":1,"lineWidth":1,"preMarketColor":"#FB8C00","postMarketColor":"#2962FF"},"highLowAvgPrice":{"highLowPriceLinesVisible":false,"highLowPriceLabelsVisible":false,"averageClosePriceLineVisible":false,"averageClosePriceLabelVisible":false,"highLowPriceLinesColor":"","highLowPriceLinesWidth":1,"averagePriceLineColor":"","averagePriceLineWidth":1},"visible":true,"showPriceLine":true,"priceLineWidth":1,"priceLineColor":"","baseLineColor":"#B2B5BE","showPrevClosePriceLine":false,"prevClosePriceLineWidth":1,"prevClosePriceLineColor":"#555555","minTick":"default","dividendsAdjustment":{},"backAdjustment":false,"settlementAsClose":true,"sessionId":"regular","sessVis":false,"statusViewStyle":{"fontSize":16,"showExchange":true,"showInterval":true,"symbolTextSource":"description"},"candleStyle":{"upColor":"#089981","downColor":"#F23645","drawWick":true,"drawBorder":true,"borderColor":"#378658","borderUpColor":"#089981","borderDownColor":"#F23645","wickColor":"#737375","wickUpColor":"#089981","wickDownColor":"#F23645","barColorsOnPrevClose":false,"drawBody":true},"hollowCandleStyle":{"upColor":"#089981","downColor":"#F23645","drawWick":true,"drawBorder":true,"borderColor":"#378658","borderUpColor":"#089981","borderDownColor":"#F23645","wickColor":"#737375","wickUpColor":"#089981","wickDownColor":"#F23645","drawBody":true},"haStyle":{"upColor":"#089981","downColor":"#F23645","drawWick":true,"drawBorder":true,"borderColor":"#378658","borderUpColor":"#089981","borderDownColor":"#F23645","wickColor":"#737375","wickUpColor":"#089981","wickDownColor":"#F23645","showRealLastPrice":false,"barColorsOnPrevClose":false,"inputs":{},"inputInfo":{},"drawBody":true},"barStyle":{"upColor":"#089981","downColor":"#F23645","barColorsOnPrevClose":false,"dontDrawOpen":false,"thinBars":true},"hiloStyle":{"color":"#2962FF","showBorders":true,"borderColor":"#2962FF","showLabels":true,"labelColor":"#2962FF","drawBody":true},"columnStyle":{"upColor":"rgba(8, 153, 129, 0.5)","downColor":"rgba(242, 54, 69, 0.5)","barColorsOnPrevClose":true,"priceSource":"close"},"lineStyle":{"color":"#2962FF","linestyle":0,"linewidth":2,"priceSource":"close","styleType":2},"areaStyle":{"color1":"rgba(41, 98, 255, 0.28)","color2":"#2962FF","linecolor":"#2962FF","linestyle":0,"linewidth":2,"priceSource":"close","transparency":100},"renkoStyle":{"upColor":"#089981","downColor":"#F23645","borderUpColor":"#089981","borderDownColor":"#F23645","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","borderUpColorProjection":"#a9dcc3","borderDownColorProjection":"#f5a6ae","wickUpColor":"#089981","wickDownColor":"#F23645","inputs":{"source":"close","sources":"Close","boxSize":3,"style":"ATR","atrLength":14,"wicks":true},"inputInfo":{"source":{"name":"Source"},"sources":{"name":"Source"},"boxSize":{"name":"Box size"},"style":{"name":"Style"},"atrLength":{"name":"ATR length"},"wicks":{"name":"Wicks"}}},"pbStyle":{"upColor":"#089981","downColor":"#F23645","borderUpColor":"#089981","borderDownColor":"#F23645","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","borderUpColorProjection":"#a9dcc3","borderDownColorProjection":"#f5a6ae","inputs":{"source":"close","lb":3},"inputInfo":{"source":{"name":"Source"},"lb":{"name":"Number of line"}}},"kagiStyle":{"upColor":"#089981","downColor":"#F23645","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","inputs":{"source":"close","style":"ATR","atrLength":14,"reversalAmount":1},"inputInfo":{"source":{"name":"Source"},"style":{"name":"Style"},"atrLength":{"name":"ATR length"},"reversalAmount":{"name":"Reversal amount"}}},"pnfStyle":{"upColor":"#089981","downColor":"#F23645","upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","inputs":{"sources":"Close","reversalAmount":3,"boxSize":1,"style":"ATR","atrLength":14,"oneStepBackBuilding":false},"inputInfo":{"sources":{"name":"Source"},"boxSize":{"name":"Box size"},"reversalAmount":{"name":"Reversal amount"},"style":{"name":"Style"},"atrLength":{"name":"ATR length"},"oneStepBackBuilding":{"name":"One step back building"}}},"baselineStyle":{"baselineColor":"#758696","topFillColor1":"rgba(8, 153, 129, 0.28)","topFillColor2":"rgba(8, 153, 129, 0.05)","bottomFillColor1":"rgba(242, 54, 69, 0.05)","bottomFillColor2":"rgba(242, 54, 69, 0.28)","topLineColor":"#089981","bottomLineColor":"#F23645","topLineWidth":2,"bottomLineWidth":2,"priceSource":"close","transparency":50,"baseLevelPercentage":50},"rangeStyle":{"upColor":"#089981","downColor":"#F23645","thinBars":true,"upColorProjection":"#a9dcc3","downColorProjection":"#f5a6ae","inputs":{"range":10,"phantomBars":false},"inputInfo":{"range":{"name":"Range"},"phantomBars":{"name":"Phantom bars"}}},"symbol":"AAPL","shortName":"AAPL","timeframe":"","onWidget":false,"interval":"1D","unitId":null,"currencyId":null,"priceAxisProperties":{"autoScale":true,"autoScaleDisabled":false,"lockScale":false,"percentage":false,"percentageDisabled":false,"log":false,"logDisabled":false,"alignLabels":true,"isInverted":false,"indexedTo100":false}}},{"type":"study_Volume","id":"FYNVl0","state":{"styles":{"vol":{"display":15,"linestyle":0,"linewidth":1,"plottype":5,"trackPrice":false,"transparency":50,"color":"#000080","histogramBase":0,"joinPoints":false,"title":"Volume"},"vol_ma":{"display":0,"linestyle":0,"linewidth":1,"plottype":0,"trackPrice":false,"transparency":0,"color":"#2196f3","histogramBase":0,"joinPoints":false,"title":"Volume MA"},"smoothedMA":{"display":0,"linestyle":0,"linewidth":1,"plottype":0,"trackPrice":false,"transparency":0,"color":"#2196f3","histogramBase":0,"joinPoints":false,"title":"Smoothed MA"}},"palettes":{"volumePalette":{"colors":{"0":{"color":"#F7525F","width":1,"style":0,"name":"Falling"},"1":{"color":"#22AB94","width":1,"style":0,"name":"Growing"}}}},"inputs":{"showMA":false,"length":20,"col_prev_close":false,"symbol":"","smoothingLine":"SMA","smoothingLength":9},"precision":"default","bands":{},"area":{},"graphics":{},"plots":{"0":{"id":"vol","type":"line"},"1":{"id":"volumePalette","palette":"volumePalette","target":"vol","type":"colorer"},"2":{"id":"vol_ma","type":"line"},"3":{"id":"smoothedMA","type":"line"}},"ohlcPlots":{},"filledAreasStyle":{},"filledAreas":{},"visible":true,"showLegendValues":true,"showLabelsOnPriceScale":true,"parentSources":{},"_metainfoVersion":53,"isTVScript":false,"isTVScriptStub":false,"is_hidden_study":false,"description":"Volume","shortDescription":"Volume","is_price_study":false,"id":"Volume@tv-basicstudies","format":{"type":"volume"},"description_localized":"Volume","shortId":"Volume","packageId":"tv-basicstudies","version":"1","fullId":"Volume@tv-basicstudies-1","productId":"tv-basicstudies","_serverMetaInfoVersion":52,"intervalsVisibilities":{"ticks":true,"seconds":true,"secondsFrom":1,"secondsTo":59,"minutes":true,"minutesFrom":1,"minutesTo":59,"hours":true,"hoursFrom":1,"hoursTo":24,"days":true,"daysFrom":1,"daysTo":366,"weeks":true,"weeksFrom":1,"weeksTo":52,"months":true,"monthsFrom":1,"monthsTo":12,"ranges":true}},"zorder":-10000,"ownFirstValue":null,"metaInfo":{"palettes":{"volumePalette":{"colors":{"0":{"name":"Falling"},"1":{"name":"Growing"}}}},"inputs":[{"id":"symbol","name":"Other Symbol","defval":"","type":"symbol","optional":true,"isHidden":false},{"id":"showMA","name":"show MA","defval":false,"type":"bool","isHidden":true},{"id":"length","name":"MA Length","defval":20,"type":"integer","min":1,"max":2000},{"defval":false,"id":"col_prev_close","name":"Color based on previous close","type":"bool"},{"id":"smoothingLine","name":"Smoothing Line","defval":"SMA","type":"text","options":["SMA","EMA","WMA"]},{"id":"smoothingLength","name":"Smoothing Length","defval":9,"type":"integer","min":1,"max":10000}],"plots":[{"id":"vol","type":"line"},{"id":"volumePalette","palette":"volumePalette","target":"vol","type":"colorer"},{"id":"vol_ma","type":"line"},{"id":"smoothedMA","type":"line"}],"graphics":{},"defaults":{"styles":{"vol":{"display":15,"linestyle":0,"linewidth":1,"plottype":5,"trackPrice":false,"transparency":50,"color":"#000080"},"vol_ma":{"display":0,"linestyle":0,"linewidth":1,"plottype":0,"trackPrice":false,"transparency":0,"color":"#2196F3"},"smoothedMA":{"display":0,"linestyle":0,"linewidth":1,"plottype":0,"trackPrice":false,"transparency":0,"color":"#2196F3"}},"palettes":{"volumePalette":{"colors":{"0":{"color":"#F7525F","width":1,"style":0},"1":{"color":"#22AB94","width":1,"style":0}}}},"inputs":{"showMA":false,"length":20,"col_prev_close":false,"symbol":"","smoothingLine":"SMA","smoothingLength":9}},"_metainfoVersion":53,"isTVScript":false,"isTVScriptStub":false,"is_hidden_study":false,"styles":{"vol":{"title":"Volume","histogramBase":0},"vol_ma":{"title":"Volume MA","histogramBase":0},"smoothedMA":{"title":"Smoothed MA","histogramBase":0}},"description":"Volume","shortDescription":"Volume","is_price_study":false,"id":"Volume@tv-basicstudies-1","format":{"type":"volume"},"description_localized":"Volume","shortId":"Volume","packageId":"tv-basicstudies","version":"1","fullId":"Volume@tv-basicstudies-1","productId":"tv-basicstudies","_serverMetaInfoVersion":52}}],"mainSourceId":"_seriesId","stretchFactor":2000,"leftAxisesState":[],"rightAxisesState":[{"state":{"id":"AdruJnUbLVFm","m_priceRange":null,"m_isAutoScale":true,"m_isPercentage":false,"m_isIndexedTo100":false,"m_isLog":false,"m_isLockScale":false,"m_isInverted":false,"m_height":703,"m_topMargin":0.1,"m_bottomMargin":0.08,"alignLabels":true,"logFormula":{"logicalOffset":4,"coordOffset":0.0001}},"sources":["_seriesId"]}],"overlayPriceScales":{"FYNVl0":{"id":"m5Vc8xG074K4","m_priceRange":null,"m_isAutoScale":true,"m_isPercentage":false,"m_isIndexedTo100":false,"m_isLog":false,"m_isLockScale":false,"m_isInverted":false,"m_height":703,"m_topMargin":0.1,"m_bottomMargin":0.08,"alignLabels":true,"logFormula":{"logicalOffset":4,"coordOffset":0.0001}}},"priceScaleRatio":null}],"timeScale":{"m_barSpacing":6,"m_rightOffset":10,"rightOffsetPercentage":5,"usePercentageRightOffset":false},"chartProperties":{"paneProperties":{"backgroundType":"solid","background":"#ffffff","backgroundGradientStartColor":"#ffffff","backgroundGradientEndColor":"#ffffff","vertGridProperties":{"color":"rgba(42, 46, 57, 0.06)","style":0},"horzGridProperties":{"color":"rgba(42, 46, 57, 0.06)","style":0},"crossHairProperties":{"color":"#9598A1","style":2,"transparency":0,"width":1},"topMargin":10,"bottomMargin":8,"axisProperties":{"autoScale":true,"autoScaleDisabled":false,"lockScale":false,"percentage":false,"percentageDisabled":false,"indexedTo100":false,"log":false,"logDisabled":false,"alignLabels":true,"isInverted":false},"legendProperties":{"showStudyArguments":true,"showStudyTitles":true,"showStudyValues":true,"showSeriesTitle":true,"showSeriesOHLC":true,"showLegend":true,"showBarChange":true,"showVolume":false,"showBackground":true,"showPriceSource":true,"backgroundTransparency":50},"separatorColor":"#E0E3EB"},"scalesProperties":{"backgroundColor":"#ffffff","lineColor":"rgba(42, 46, 57, 0)","textColor":"#131722","fontSize":12,"scaleSeriesOnly":false,"showSeriesLastValue":true,"seriesLastValueMode":1,"showSeriesPrevCloseValue":false,"showStudyLastValue":true,"showSymbolLabels":false,"showStudyPlotLabels":false,"showBidAskLabels":false,"showPrePostMarketPriceLabel":true,"showFundamentalNameLabel":false,"showFundamentalLastValue":true,"barSpacing":6,"axisHighlightColor":"rgba(41, 98, 255, 0.25)","axisLineToolLabelBackgroundColorCommon":"#2962FF","axisLineToolLabelBackgroundColorActive":"#143EB3","showPriceScaleCrosshairLabel":true,"showTimeScaleCrosshairLabel":true,"crosshairLabelBgColorLight":"#131722","crosshairLabelBgColorDark":"#363A45"},"chartEventsSourceProperties":{"visible":true,"futureOnly":true,"breaks":{"color":"#555555","visible":false,"style":2,"width":1}},"tradingProperties":{"showPositions":true,"positionPL":{"visibility":true,"display":0},"bracketsPL":{"visibility":true,"display":0},"showOrders":true,"showExecutions":true,"showExecutionsLabels":false,"showReverse":true,"horizontalAlignment":2,"extendLeft":true,"lineLength":5,"lineWidth":1,"lineStyle":0},"priceScaleSelectionStrategyName":"auto"},"sessions":{"properties":{"graphics":{"backgrounds":{"outOfSession":{"color":"#2962FF","transparency":92,"visible":false},"preMarket":{"color":"#FF9800","transparency":92,"visible":false},"postMarket":{"color":"#2962FF","transparency":92,"visible":false}},"vertlines":{"sessBreaks":{"color":"#4985e7","style":2,"visible":false,"width":1}}}}},"version":3,"timezone":"Etc/UTC","shouldBeSavedEvenIfHidden":false,"lineToolsGroups":{"groups":[]},"chartId":"1"}],"symbolLock":0,"intervalLock":0,"trackTimeLock":0,"dateRangeLock":0,"crosshairLock":1,"layoutsSizes":{"s":[{"percent":1}]}}`;
const savedData = JSON.parse(savedChartDataString);
savedData.charts[0].panes[0].sources[0].state.candleStyle.upColor =
colors.saved_data;
savedData.charts[0].panes[0].sources[0].state.candleStyle.downColor =
colors.saved_data;
const loadData = JSON.parse(savedChartDataString);
loadData.charts[0].panes[0].sources[0].state.candleStyle.upColor =
colors.widgetLoad;
loadData.charts[0].panes[0].sources[0].state.candleStyle.downColor =
colors.widgetLoad;
function initOnReady() {
var widget = (window.tvWidget = new TradingView.widget({
library_path:
"https://charting-library.tradingview-widget.com/charting_library/",
// debug: true, // uncomment this line to see Library errors and warnings in the console
fullscreen: true,
symbol: "AAPL",
interval: "1D",
container: "tv_chart_container",
datafeed: new Datafeeds.UDFCompatibleDatafeed(
"https://demo-feed-data.tradingview.com"
),
locale: "en",
disabled_features: [],
enabled_features: [],
useSavedData && { (
saved_data: savedData
}),
useOverrides && { (
overrides: {
"mainSeriesProperties.candleStyle.upColor": colors.overrides,
"mainSeriesProperties.candleStyle.downColor": colors.overrides
}
}),
useSettingsOverrides && { (
settings_overrides: {
"mainSeriesProperties.candleStyle.upColor": colors.settingsOverrides,
"mainSeriesProperties.candleStyle.downColor": colors.settingsOverrides
}
}),
useSettingsAdapter && { (
settings_adapter: {
initialSettings: {
"chartproperties.mainSeriesProperties": JSON.stringify(
initialSettingsStyle
)
},
setValue: function (key, value) {
console.log(`set value: ${key} ${value}`);
},
removeValue: function (key) {
console.log(`remove value: ${key}`);
}
}
})
}));
widget.onChartReady(() => {
if (useLoad) widget.load(loadData);
if (useApplyOverrides) {
widget.applyOverrides({
"mainSeriesProperties.candleStyle.upColor": colors.applyOverrides,
"mainSeriesProperties.candleStyle.downColor": colors.applyOverrides
});
}
});
}
window.addEventListener("DOMContentLoaded", initOnReady, false);
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.