tradingView--K线图 使用

相关链接

tradingView官网地址:https://cn.tradingview.com/
官方文档链接:https://github.com/tradingview/charting_library/wiki(需向官方申请)
中文文档链接:https://zlq4863947.gitbook.io/tradingview/
在不同的框架上运行 tradingview:https://github.com/tradingview/charting-library-examples
下载资源:https://download.csdn.net/download/qq_39664702/15416757

实现dome

代码没有删减,直接复制不可用,仅供参考

<template>
  <div>
    <div id='tv_chart_container' style='width: 100%; height: 420px'></div>
  </div>
</template>

<style scoped>
iframe {
  height: 460px !important;
}
</style>
<script>
import $ from 'jquery';
import markets from '@/api/currencyMarket.js';
import { mapState } from 'vuex';
import configs from './config';
import tabsConfig from './config/tabs';
let aa = null;
let config
//  import TvTop from './tvTop.vue';
export default {
  name: 'tv',
  //  components: { TvTop },
  props: {
  },
  data() {
    return {
      widget: null,
      symbolInfo: null,
      feed: null,
      wsEx: null,
      ws: null,
      reals: null,
      lists: [],
      newData: '',
      priceScale: 100000,
      histime: '',
      socketTypr: false,
      bg_: '#fff',
      isDay: '',
      grid: '#cbcbcb',
      cross: '#cbcbcb',
      onRealtimeCallback: null, // websocket数据回调
    };
  },
  created() { },
  computed: {
    ...mapState({
      colorVersion: (state) => state.coin.coinPage.colorVersion, // 币币页面颜色版本
      KVersion: (state) => state.coin.coinPage.KVersion, // /基础版,专业版,深度图 btn
      newCoinInfo: (state) => state.market.newCoinInfo, // 当前展示交易对信息
      klineData: (state) => state.market.klineData, // k线实时数据推送
      tradingPrecision: (state) => state.market.tradingPrecision,
    }),
    lang() {
      if (this.$store.state.public.lang == 'zh_CN') {
        return 'zh';
      } else {
        return this.$store.state.public.lang;
      }
    },
    // 币对名称
    symbol() {
      // 监听交易对
      return this.newCoinInfo.exchangeCoin;
    },
    // 当前交易区信息
    exchangeCoin() {
      return this.symbol.split('/')[1];
    },
    // 当前币种信息
    coinName() {
      return this.symbol.split('/')[0];
    },
    // 小数位
    decimal() {
      let deci = 1;
      if (this.tradingPrecision[this.exchangeCoin]) {
        let num = Number(
          this.tradingPrecision[this.exchangeCoin][this.coinName]['price']
        );
        for (let i = 0; i < num; i++) {
          deci *= 10;
        }
      } else {
        deci = 100;
      }
      return deci;
    },
  },
  watch: {
    klineData(val) {
      try {
        aa({
          time: Number(val.time * 1000),
          close: Number(val.close),
          open: Number(val.open),
          high: Number(val.high),
          low: Number(val.low),
          volume: Number(val.vol),
        });
      } catch (e) { }
    },
    symbol(a, b) {
      // 监听交易对
      if (a != b && b != '') {
        this.widget.setSymbol(
          a,
          localStorage.getItem('tim'),
          function onReadyCallback() { }
        ); // 切换币种
        //  this.$store.state.symbol=b
      }
    },
    $route: {
      handler(val, oldval) {
        console.log(val);// 新路由信息
        console.log(oldval);// 老路由信息
      },
      //  深度观察监听
      deep: true,
    },
    'newCoinInfo.exchangeCoin'() {
      this.updateWidget();
    },
    // 监听颜色切换
    colorVersion() {
      if (localStorage.getItem('tradingview.chartproperties')) localStorage.setItem('tradingview.chartproperties', '')
      if (localStorage.getItem('tradingview.chartproperties.mainSeriesProperties')) localStorage.setItem('tradingview.chartproperties.mainSeriesProperties', '')

      this.updateWidget();
    },
    // 切换基础版和专业版的按钮
    KVersion(val) {
      if (val != 2) {
        this.updateWidget();
      }
    },
  },
  mounted() {
    if (this.KVersion != 2) this.createWidget();
  },
  destroyed() {
    if (this.socket) {
      this.socket.disconnect();
    }
    let type = localStorage.getItem('type');
    this.$wsSend.getKline('unsub', type, this.symbol);
    this.removeWidget();
  },
  beforeDestroy() { },

  methods: {
    format(shijianchuo) {
      // shijianchuo是整数,否则要parseInt转换
      var time = new Date(shijianchuo);
      var y = time.getFullYear();
      var m = time.getMonth() + 1;
      var d = time.getDate();
      var h = time.getHours();
      var mm = time.getMinutes();
      var s = time.getSeconds();
      return (
        y +
        '-' +
        this.add0(m) +
        '-' +
        this.add0(d) +
        ' ' +
        this.add0(h) +
        ':' +
        this.add0(mm) +
        ':' +
        this.add0(s)
      );
    },
    add0(m) {
      return m < 10 ? '0' + m : m;
    },
    connect(real) {
      // 封装推送数据
      aa = real;
      this.socketTypr = true;
      let type = localStorage.getItem('type');
      this.$wsSend.getKline('sub', type, this.symbol);
    },
    createWidget() {
      if (this.colorVersion == 'dark') {
        if (this.KVersion == 0) {//简版
          config = configs.dark_simple;
        } else {
          config = configs.dark_professional;
        }
      } else {
        if (this.KVersion == 0) {//简版
          config = configs.black_simple;
        } else {
          config = configs.black_professional;
        }
      }

      let _this = this;
      this.$nextTick(function () {
        let widget = (_this.widget = new TradingView.widget({
          symbol: _this.symbol,
          interval: localStorage.getItem('tim') || 15,
          fullscreen: false, // 是否占用视图所有空间
          //  preset: 'mobile',
          custom_css_url: _this.colorVersion === 'bright' ? 'white.css' : 'block.css',
          toolbar_bg: _this.colorVersion === 'bright' ? '#FFFFFF' : '#171B2B', // 背景色
          loading_screen: {
            backgroundColor:
              _this.colorVersion == 'bright' ? '#FFFFFF' : '#171B2B',
            foregroundColor:
              _this.colorVersion == 'bright' ? '#FFFFFF' : '#171B2B',
          },
          debug: false,
          autosize: true,
          container_id: 'tv_chart_container',
          datafeed: _this.createFeed(),
          library_path: 'charting_library-master/charting_library/',
          locale: _this.lang,
          charts_storage_api_version: '1.1',
          timezone: 'Asia/Shanghai',
          // 配置项
          ...config,
        }));
        widget.headerReady().then(function () {
          if (_this.KVersion == 0) {//简版
            // 图表方法
            _this.MALine5 = widget.activeChart().createStudy('Moving Average', false, false, [5], null);
            _this.MALine10 = widget.activeChart().createStudy('Moving Average', false, false, [10], null);
            _this.MALine30 = widget.activeChart().createStudy('Moving Average', false, false, [30], null);
          } else {//专业版
            // 图表方法
            _this.MALine5 = widget.activeChart().createStudy('Moving Average', false, false, [5], null);
            _this.MALine10 = widget.activeChart().createStudy('Moving Average', false, false, [10], null);
            _this.MALine30 = widget.activeChart().createStudy('Moving Average', false, false, [30], null);
            _this.MALine60 = widget.activeChart().createStudy('Moving Average', false, false, [60], null);
          }
          
          let interval = localStorage.getItem('type') || '15min';
          let timInterval = localStorage.getItem('tim') || '15';
          let buttonArr = tabsConfig;
          buttonArr.forEach((v) => {
            var button = widget.createButton();
            button.setAttribute('title', v.text);
            button.textContent = v.text;
            button.classList.add('mydate');

            if (v.text == interval) {
              button.classList.add('s_active');
              localStorage.setItem('tim', timInterval); // 默认为15分钟
              localStorage.setItem('type', interval); // 默认为15
            }

            button.addEventListener('click', function (e) {

              let dom = e.currentTarget.parentNode.parentNode.parentNode.childNodes;
              for (var i = 0; i < dom.length; i++) {
                if (dom[i].hasChildNodes()) {
                  if (dom[i].childNodes[0].childNodes[0].className.indexOf('s_active') > -1) {
                    dom[i].childNodes[0].childNodes[0].className = dom[i].childNodes[0].childNodes[0].className.replace('s_active', '');
                  }
                }
              } // 去掉15分钟的
              $(e.target)
                .addClass('s_active')
                .closest('div.space-single')
                .siblings('div.space-single')
                .find('div.button')
                .removeClass('s_active');

              _this.setSymbol = function (symbol, value) {
                gh.chart().setSymbol(symbol, value);
              };
              if (v.type != 'min') {
                localStorage.setItem('tim', v.value);
                localStorage.setItem('type', v.type);
                widget.chart().setResolution(v.value, function onReadyCallback() { }); // 改变分辨率

              } else {
                // console.log(_this.MALine5)
                // widget.activeChart().getStudyById(_this.MALine5).setVisible(false);
                // widget.activeChart().getStudyById(_this.MALine10).setVisible(false);
                // widget.activeChart().getStudyById(_this.MALine30).setVisible(false);
                // widget.chart().getStudyById(_this.MALine60).setVisible(false);
                localStorage.setItem('tim', 1);
                localStorage.setItem('type', '1min');
                widget.chart().setResolution(1, function onReadyCallback() { }); // 改变分辨率

              }
              widget.chart().setChartType(v.chartType); // 改变K线类型
            });

          })

        });

        _this.widget = widget;
      });
    },
    createFeed() {
      let this_vue = this;
      let Datafeed = {};

      Datafeed.DataPulseUpdater = function (datafeed, updateFrequency) {
        this._datafeed = datafeed;
        this._subscribers = {};

        this._requestsPending = 0;
        var that = this;

        var update = function () {
          if (that._requestsPending > 0) {
            return;
          }
          for (var listenerGUID in that._subscribers) {
            var subscriptionRecord = that._subscribers[listenerGUID];
            var resolution = subscriptionRecord.resolution;

            var datesRangeRight = parseInt(new Date().valueOf() / 1000);
            // 	BEWARE: please note we really need 2 bars, not the only last one
            // 	see the explanation below. `10` is the `large enough` value to work around holidays
            var datesRangeLeft =
              datesRangeRight - that.periodLengthSeconds(resolution, 60 * 24);

            that._requestsPending++;
            (function (_subscriptionRecord) {
              //  eslint-disable-line
              that._datafeed.getBars(
                _subscriptionRecord.symbolInfo,
                resolution,
                datesRangeLeft,
                datesRangeRight,
                function (bars) {
                  that._requestsPending--;

                  // 	means the subscription was cancelled while waiting for data
                  if (!that._subscribers.hasOwnProperty(listenerGUID)) {
                    return;
                  }

                  if (bars.length === 0) {
                    return;
                  }

                  var lastBar = bars[bars.length - 1];
                  if (
                    !isNaN(_subscriptionRecord.lastBarTime) &&
                    lastBar.time < _subscriptionRecord.lastBarTime
                  ) {
                    return;
                  }

                  var subscribers = _subscriptionRecord.listeners;

                  // 	BEWARE: this one isn't working when first update comes and this update makes a new bar. In this case
                  // 	_subscriptionRecord.lastBarTime = NaN
                  var isNewBar =
                    !isNaN(_subscriptionRecord.lastBarTime) &&
                    lastBar.time > _subscriptionRecord.lastBarTime;

                  // 	Pulse updating may miss some trades data(ie, if  pulse period = 10 secods and new bar is 
                  // started 5 seconds later after the last update, the
                  // 	old bar's last 5 seconds trades will be lost). Thus, at fist we should broadcast old bar updates when it's ready.
                  if (isNewBar) {
                    if (bars.length < 2) {
                      throw new Error(
                        'Not enough bars in history for proper pulse update. Need at least 2.'
                      );
                    }

                    var previousBar = bars[bars.length - 2];
                    for (let i = 0; i < subscribers.length; ++i) {
                      subscribers[i](previousBar);
                    }
                  }

                  _subscriptionRecord.lastBarTime = lastBar.time;

                  for (let i = 0; i < subscribers.length; ++i) {
                    subscribers[i](lastBar);
                  }
                },

                // 	on error
                function () {
                  that._requestsPending--;
                }
              );
            })(subscriptionRecord);
          }
        };
        update();
        if (that._subscribers == {}) {
          setInterval(update(), updateFrequency);
        }
      };

      Datafeed.DataPulseUpdater.prototype.periodLengthSeconds = function (
        resolution,
        requiredPeriodsCount
      ) {
        var daysCount = 0;

        if (resolution === 'D') {
          daysCount = requiredPeriodsCount;
        } else if (resolution === 'M') {
          daysCount = 31 * requiredPeriodsCount;
        } else if (resolution === 'W') {
          daysCount = 7 * requiredPeriodsCount;
        } else {
          daysCount = resolution;
        }

        return daysCount * 300;
      };

      Datafeed.DataPulseUpdater.prototype.subscribeDataListener = function (
        symbolInfo,
        resolution,
        newDataCallback,
        listenerGUID
      ) {
        this._datafeed._logMessage('Subscribing ' + listenerGUID);

        if (!this._subscribers.hasOwnProperty(listenerGUID)) {
          this._subscribers[listenerGUID] = {
            symbolInfo: symbolInfo,
            resolution: resolution,
            lastBarTime: NaN,
            listeners: [],
          };
        }

        this._subscribers[listenerGUID].listeners.push(newDataCallback);
      };

      Datafeed.DataPulseUpdater.prototype.unsubscribeDataListener = function (
        listenerGUID
      ) {
        this._datafeed._logMessage('Unsubscribing ' + listenerGUID);
        delete this._subscribers[listenerGUID];
      };

      Datafeed.Container = function (updateFrequency) {
        this._configuration = {
          supports_search: false,
          supports_group_request: false,
          supported_resolutions: [
            '1',
            '3',
            '5',
            '15',
            '30',
            '60',
            '120',
            '240',
            '360',
            '720',
            '1D',
            '3D',
            '1W',
            '1M',
          ],
          supports_marks: true,
          supports_timescale_marks: true,
          exchanges: ['gh'],
        };

        this._barsPulseUpdater = new Datafeed.DataPulseUpdater(
          this,
          updateFrequency || 10 * 1000
        );

        //  this._quotesPulseUpdater = new Datafeed.QuotesPulseUpdater(this);

        this._enableLogging = true;
        this._callbacks = {};

        this._initializationFinished = true;
        this._fireEvent('initialized');
        this._fireEvent('configuration_ready');
      };

      Datafeed.Container.prototype._fireEvent = function (event, argument) {
        if (this._callbacks.hasOwnProperty(event)) {
          var callbacksChain = this._callbacks[event];
          for (var i = 0; i < callbacksChain.length; ++i) {
            callbacksChain[i](argument);
          }

          this._callbacks[event] = [];
        }
      };

      Datafeed.Container.prototype._logMessage = function () {

      };

      Datafeed.Container.prototype.on = function (event, callback) {
        if (!this._callbacks.hasOwnProperty(event)) {
          this._callbacks[event] = [];
        }

        this._callbacks[event].push(callback);
        return this;
      };

      Datafeed.Container.prototype.onReady = function (callback) {
        let that = this;
        if (that._configuration) {
          setTimeout(function () {
            callback(that._configuration);
          }, 0);
        } else {
          this.on('configuration_ready', function () {
            callback(that._configuration);
          });
        }
      };

      Datafeed.Container.prototype.resolveSymbol = function (
        symbolName,
        onSymbolResolvedCallback,
      ) {
        this._logMessage('GOWNO :: resolve symbol ' + symbolName);
        Promise.resolve().then(() => {
          onSymbolResolvedCallback({
            name: this_vue.symbol,
            pricescale: parseInt(this_vue.decimal),
            minmov: 1, // minmov(最小波动), pricescale(价格精度), minmove2, fractional(分数)
            minmov2: 0, // 这是一个神奇的数字来格式化复杂情况下的价格。
            //  pricescale:8,
            pointvalue: 1,
            fractional: false,
            ticker: this_vue.symbol,
            description: '',
            type: 'bitcoin',
            volume_precision: 8,
            //  'exchange-traded': 'sdt',
            //  'exchange-listed': 'sdt',
            // 现在,这两个字段都为某个交易所的略称。将被显示在图表的图例中,以表示此商品。目前此字段不用于其他目的。
            has_intraday: true,
            // 设置是否支持周月线
            has_daily: true,
            // 设置是否支持周月线
            has_weekly_and_monthly: true,
            has_no_volume: false, // 布尔表示商品是否拥有成交量数据。
            session: '24x7',
            supported_resolutions: [
              '1',
              '3',
              '5',
              '15',
              '30',
              '60',
              '120',
              '240',
              '360',
              '720',
              '1D',
              '3D',
              '1W',
              '1M',
            ],
            data_status: 'streaming', // 数据状态(streaming(实时),endofday(已收盘),pulsed(脉冲),delayed_streaming(延迟流动中))
          });
        });
      };

      // 初始化数据
      Datafeed.Container.prototype.getBars = function (
        symbolInfo,
        resolution,
        rangeStartDate,
        rangeEndDate,
        onHistoryCallback,
      ) {
        let interval = localStorage.getItem('type') || '15min';
        let params = {
          symbol: symbolInfo.name,
          period: interval,
          from: rangeStartDate,
          to: rangeEndDate,
        };
        markets.getHistoryKline(params).then((res) => {
          let array = res.result;
          array.reverse();
          if (array && array.length > 0) {
            array.forEach((item) => {
              item.open = Number(item.open);
              item.close = Number(item.close);
              item.high = Number(item.high);
              item.low = Number(item.low);
              item.volume = Number(item.vol);
              item.time = Number(item.time * 1000);
            });
            onHistoryCallback(array, { noData: false });
            //  onHistoryCallback([], { noData: true });
          }
          if (!array || (array && array.length == 0)) {
            onHistoryCallback([], { noData: true });
          }
        });
      };
      // 实时数据
      Datafeed.Container.prototype.subscribeBars = function (
        symbolInfo,
        resolution,
        onRealtimeCallback,
      ) {
        //  this._barsPulseUpdater.subscribeDataListener(symbolInfo, resolution, onRealtimeCallback, listenerGUID, onResetCacheNeededCallback);
        this_vue.connect(onRealtimeCallback);
        this.onRealtimeCallback = onRealtimeCallback;
      };

      Datafeed.Container.prototype.unsubscribeBars = function (listenerGUID) {
        this._barsPulseUpdater.unsubscribeDataListener(listenerGUID);
      };

      return new Datafeed.Container();
    },

    updateWidget(item) {
      let type = localStorage.getItem('type');
      this.$wsSend.getKline('unsub', type, this.symbol);
      this.symbolInfo = {
        name: item,
        ticker: item,
        description: '',
        session: '24x7',
        supported_resolutions: [
          '1',
          '3',
          '5',
          '15',
          '30',
          '60',
          '120',
          '240',
          '360',
          '720',
          '1D',
          '3D',
          '1W',
          '1M',
        ],
        has_intraday: true,
        has_daily: true,
        has_weekly_and_monthly: true,
      };

      this.removeWidget();
      this.createWidget();
    },
    removeWidget() {

    },
  },
};
</script>

配置

index.js
import black_professional from "./black_professional";
import dark_professional from "./dark_professional";
import black_simple from "./black_simple";
import dark_simple from "./dark_simple";

export default {
    black_professional,
    dark_professional,
    black_simple,
    dark_simple,
    // loading_screen,
   
}
black_professional.js
const color = {
  //整体背景色
  Kbg:"#FFFFFF",
  //亮红色
  KbRed:"#FA4A4A",
  //亮绿色
  KbGreen:"#05B47F",
  //暗红色
  KdRed:"#FA5050",
  //暗绿色
  KdGreen:"#0AB985",
  //字体色
  Kfont:"#A6ADB5",
  //选中字体色
  KSFont:"#6E7682",
  //选中背景色
  KSBg:"#DFE2E7",
  //坐标轴色
  KCoordinate:"#A5ABB3",
  //网格线色
  KGridLines:"#F7F8F8 ",
  //日线颜色
  KDay:{
    "day5":"#965fc4",
    "day10":"#84aad5",
    "day30":"#55b263",
    "day60":"#b7248a",
  },
  //鼠标虚线颜色
  KMouse:"#c5c6ca",
  //btn字体选中色
  KSBtnFont:"#2483ff",
  //btn背景选中色
  KSBtnBg:"rgba(229,235,245,.5)",
  //btn border
  KSBtnBorder:"#e6ecf2",
  //面积图背景色
  KgArea1:"rgba(243,243,243,0.6)",
  KgArea2:"rgba(250,250,250,0.6)",
  //面积图边框色
  KbArea:"#929aa5"
}
const data = {
  studies_overrides:{
    //柱状图颜色
      "volume.volume.color.0": color.KdRed,  //第一根的颜色
      "volume.volume.color.1": color.KdGreen,  //第二根的颜色
      "volume.volume.transparency": 100,    //透明度
      "volume.volume ma.color": "#FFFFFF", //波浪图颜色
      "volume.volume ma.transparency": 1, //波浪图透明度
      "KDay": color.KDay,  
      // "volume.volume ma.linewidth": 0,    
      // "volume.show ma": true,    //是否显示
      // "volume.options.showStudyArguments": true,
      // "bollinger bands.median.color": "#33FF88",
      // "bollinger bands.upper.linewidth": 7,
      // // MACD样式
      // "MACD.MACD.color": "#F00",
      // "MACD.Signal.color": "#fe8",
      // "MACD.Histogram.color": "#0f0",
      // 'MACD.MACD.linewidth': 1,
  },
  disabled_features:[
    'show_hide_button_in_legend',
    'study_buttons_in_legend',
    'source_selection_markers',
    "header_interval_dialog_button",
    "header_symbol_search",//头部搜索
    "header_saveload",//上传下载
    "header_screenshot",//截图
    "header_chart_type",// k线样式
    "header_undo_redo",//撤销返回
    "timeframes_toolbar",//下面的时间
    "volume_force_overlay",//防止他们重叠
    "header_compare",//图表对比
    "header_resolutions",//todo: przetestowac//头部的时间
    'countdown',//倒计时
    'pane_context_menu',
    'scales_context_menu',

    
    "show_interval_dialog_on_key_press",
    "symbol_search_hot_key",
    "study_dialog_search_control",
    "display_market_status",
    
    
    "symbol_info",//商品信息
    "border_around_the_chart",
    "main_series_scale_menu",
    "star_some_intervals_by_default",
    "datasource_copypaste",
    // "right_bar_stays_on_scroll",

    "go_to_date",
    "compare_symbol",
    "border_around_the_chart",
    "timezone_menu",
    
    'chart_property_page_style',
    "control_bar",//todo: przetestowac
    "remove_library_container_border",
    "use_localstorage_for_settings",
    "save_chart_properties_to_local_storage"
  ],
  enabled_features:[
    "adaptive_logo", //小屏幕上隐藏 'charts byTradingView' 文本
    "dont_show_boolean_study_arguments", //是否隐藏指标参数
    "hide_last_na_study_output", //隐藏最后一次指标输出
    "move_logo_to_main_pane", //logo在中间位置
    "same_data_requery", //允许您使用相同的商品调用 setSymbol 来刷新数据
    // "hide_left_toolbar_by_default", //第一次打开图表时隐藏左工具栏
    "side_toolbar_in_fullscreen_mode", //使用此功能,您可以在全屏模式下启用绘图工具栏
    "disable_resolution_rebuild", //显示的时间与得到的数据时间一致
    "seconds_resolution",//支持秒的周期
    'hide_last_na_study_output', // 隐藏指标后面的 n/a
    "remove_library_container_border",
    "constraint_dialogs_movement",//todo: nie do końca jestem pewien
    
  ],
  overrides:{
    "symbolWatermarkProperties.color": color.Kbg,
      "paneProperties.background": color.Kbg,
      "paneProperties.vertGridProperties.color": color.KGridLines,
      "paneProperties.horzGridProperties.color": color.KGridLines,
      "paneProperties.crossHairProperties.color": color.KMouse,
      "paneProperties.crossHairProperties.style": 2,
      // 数据列风格。 请参阅下面的支持的值
      //  Bars = 0            #美国线
      //  Candles = 1         #K线图
      //  Line = 2            #线形图
      //  Area = 3            #面积图
      //  Heiken Ashi = 8     #平均K线图
      //  Hollow Candles = 9  #空心K线图
      //  Renko = 4           #转形图
      //  Kagi = 5            #卡吉图
      //  Point&Figure = 6    #点数图
      //  Line Break = 7      #新价图
      "mainSeriesProperties.style": 1,
      "mainSeriesProperties.showCountdown": false,
      "scalesProperties.showSeriesLastValue": true,
      "mainSeriesProperties.visible": false,
      "mainSeriesProperties.showPriceLine": true,
      "mainSeriesProperties.priceLineWidth": 1,
      "mainSeriesProperties.lockScale": false,
      "mainSeriesProperties.minTick": "default",
      "mainSeriesProperties.extendedHours": false,
      "volumePaneSize": "medium",//底部视图大小 支持的值: large, medium, small, tiny
      editorFontsList: ["Lato", "Arial", "Verdana", "Courier New", "Times New Roman"],
      "paneProperties.topMargin": 5,
      "paneProperties.bottomMargin": 5,
      "paneProperties.legendProperties.showLegend": true, //收起左上角指标
      "paneProperties.leftAxisProperties.autoScale": true,
      "paneProperties.leftAxisProperties.autoScaleDisabled": false,
      "paneProperties.leftAxisProperties.percentage": false,
      "paneProperties.leftAxisProperties.percentageDisabled": false,
      "paneProperties.leftAxisProperties.log": false,
      "paneProperties.leftAxisProperties.logDisabled": false,
      "paneProperties.leftAxisProperties.alignLabels": true,
      // "paneProperties.legendProperties.showStudyArguments": true,
      "paneProperties.legendProperties.showStudyTitles": true,
      "paneProperties.legendProperties.showStudyValues": true,
      "paneProperties.legendProperties.showSeriesTitle": true,
      "paneProperties.legendProperties.showSeriesOHLC": true,//开高低
      "scalesProperties.showLeftScale": false,
      "scalesProperties.showRightScale": true,
      "scalesProperties.backgroundColor": color.KCoordinate,
      "scalesProperties.lineColor": color.KCoordinate,
      "scalesProperties.textColor": color.Kfont,
      "scalesProperties.scaleSeriesOnly": false,
      "mainSeriesProperties.priceAxisProperties.autoScale": true,
      "mainSeriesProperties.priceAxisProperties.autoScaleDisabled": false,
      "mainSeriesProperties.priceAxisProperties.percentage": false,
      "mainSeriesProperties.priceAxisProperties.percentageDisabled": false,
      "mainSeriesProperties.priceAxisProperties.log": false,
      "mainSeriesProperties.priceAxisProperties.logDisabled": false,
      "mainSeriesProperties.candleStyle.upColor": color.KbGreen,
      "mainSeriesProperties.candleStyle.downColor": color.KbRed,
      "mainSeriesProperties.candleStyle.drawWick": true,
      "mainSeriesProperties.candleStyle.drawBorder": true,
      "mainSeriesProperties.candleStyle.borderUpColor": color.KbGreen,
      "mainSeriesProperties.candleStyle.borderDownColor": color.KbRed,
      "mainSeriesProperties.candleStyle.wickUpColor": color.KbGreen,
      "mainSeriesProperties.candleStyle.wickDownColor": color.KbRed,
      "mainSeriesProperties.candleStyle.barColorsOnPrevClose": false,
      "mainSeriesProperties.hollowCandleStyle.upColor": color.KbGreen,
      "mainSeriesProperties.hollowCandleStyle.downColor": color.KbRed,
      "mainSeriesProperties.hollowCandleStyle.drawWick": true,
      "mainSeriesProperties.hollowCandleStyle.drawBorder": true,
      "mainSeriesProperties.hollowCandleStyle.borderColor": color.KbGreen,
      "mainSeriesProperties.hollowCandleStyle.borderUpColor": color.KbGreen,
      "mainSeriesProperties.hollowCandleStyle.borderDownColor": color.KbRed,
      "mainSeriesProperties.hollowCandleStyle.wickUpColor": color.KbGreen,
      "mainSeriesProperties.hollowCandleStyle.wickDownColor": color.KbRed,
      "mainSeriesProperties.haStyle.upColor": color.KbGreen,
      "mainSeriesProperties.haStyle.downColor": color.KbRed,
      "mainSeriesProperties.haStyle.drawWick": true,
      "mainSeriesProperties.haStyle.drawBorder": true,
      "mainSeriesProperties.haStyle.borderColor": color.KbGreen,
      "mainSeriesProperties.haStyle.borderUpColor": color.KbGreen,
      "mainSeriesProperties.haStyle.borderDownColor": color.KbRed,
      "mainSeriesProperties.haStyle.wickUpColor": color.KbGreen,
      "mainSeriesProperties.haStyle.wickDownColor": color.KbRed,
      "mainSeriesProperties.haStyle.barColorsOnPrevClose": false,
      "mainSeriesProperties.barStyle.upColor": color.KbGreen,
      "mainSeriesProperties.barStyle.downColor": color.KbRed,
      "mainSeriesProperties.barStyle.barColorsOnPrevClose": false,
      "mainSeriesProperties.barStyle.dontDrawOpen": false,
      "mainSeriesProperties.lineStyle.color": color.KCoordinate,
      "mainSeriesProperties.lineStyle.linestyle": 0,
      "mainSeriesProperties.lineStyle.linewidth": 1,
      "mainSeriesProperties.lineStyle.priceSource": "close",

      "mainSeriesProperties.areaStyle.color1": color.KgArea2,
      "mainSeriesProperties.areaStyle.color2": color.KgArea1,
      "mainSeriesProperties.areaStyle.linecolor": color.KbArea,
      "mainSeriesProperties.areaStyle.linestyle": 0,
      "mainSeriesProperties.areaStyle.linewidth": 1,
      "mainSeriesProperties.areaStyle.priceSource": "close",
      "mainSeriesProperties.areaStyle.transparency": 80,
  }
  
}


export default data;
black_simple.js
const color = {
  //整体背景色
  Kbg:"#FFFFFF",
  //亮红色
  KbRed:"#ff575c",
  //亮绿色
  KbGreen:"#3dcc89",
  //暗红色
  KdRed:"#ff575c",
  //暗绿色
  KdGreen:"#3dcc89",
  //字体色
  Kfont:"#A6ADB5",
  //选中字体色
  KSFont:"#6E7682",
  //选中背景色
  KSBg:"#DFE2E7",
  //坐标轴色
  KCoordinate:"#A5ABB3",
  //网格线色
  KGridLines:"#F7F8F8 ",
  //日线颜色
  KDay:{
    "day5":"rgb(240,185,11)",
    "day10":"rgb(16,170,8)",
    "day30":"rgb(255,0,255)",
  },
  //鼠标虚线颜色
  KMouse:"#c5c6ca",
  //btn字体选中色
  KSBtnFont:"#2483ff",
  //btn背景选中色
  KSBtnBg:"rgba(229,235,245,.5)",
  //btn border
  KSBtnBorder:"#e6ecf2",
  //面积图背景色
  KgArea1:"rgba(243,243,243,0.6)",
  KgArea2:"rgba(250,250,250,0.6)",
  //面积图边框色
  KbArea:"#929aa5"
}
const data = {
  studies_overrides:{
    //柱状图颜色
    "volume.volume.color.0": color.KdRed,  //第一根的颜色
    "volume.volume.color.1": color.KdGreen,  //第二根的颜色
    "volume.volume.transparency": 1,    //透明度
    "volume.volume ma.color": "#FFFFFF", //波浪图颜色
    "volume.volume ma.transparency": 1, //波浪图透明度
    "KDay": color.KDay,  
    // "volume.volume ma.linewidth": 0,    
    // "volume.show ma": true,    //是否显示
    // "volume.options.showStudyArguments": true,
    // "bollinger bands.median.color": "#33FF88",
    // "bollinger bands.upper.linewidth": 7,
    // // MACD样式
    // "MACD.MACD.color": "#F00",
    // "MACD.Signal.color": "#fe8",
    // "MACD.Histogram.color": "#0f0",
    // 'MACD.MACD.linewidth': 1,
  },
  disabled_features:[
    'property_pages',
    "left_toolbar",//左部工具栏
    'header_settings',//指标
    'header_fullscreen_button',//全屏
    'legend_context_menu',
    'context_menus',
    'header_indicators',
    "edit_buttons_in_legend",
    // 'legend_widget',
    'format_button_in_legend',
    'delete_button_in_legend',

    'show_hide_button_in_legend',
    'study_buttons_in_legend',
    'source_selection_markers',
    "header_interval_dialog_button",
    "header_symbol_search",//头部搜索
    "header_saveload",//上传下载
    "header_screenshot",//截图
    "header_chart_type",// k线样式
    "header_undo_redo",//撤销返回
    "timeframes_toolbar",//下面的时间
    "volume_force_overlay",//防止他们重叠
    "header_compare",//图表对比
    "header_resolutions",//todo: przetestowac//头部的时间
    'countdown',//倒计时
    'pane_context_menu',
    'scales_context_menu',

    
    "show_interval_dialog_on_key_press",
    "symbol_search_hot_key",
    "study_dialog_search_control",
    "display_market_status",
    
    
    "symbol_info",//商品信息
    "border_around_the_chart",
    "main_series_scale_menu",
    "star_some_intervals_by_default",
    "datasource_copypaste",
    // "right_bar_stays_on_scroll",

    "go_to_date",
    "compare_symbol",
    "border_around_the_chart",
    "timezone_menu",
    
    'chart_property_page_style',
    "control_bar",//todo: przetestowac
    "remove_library_container_border",
  ],
  enabled_features:[
    "adaptive_logo", //小屏幕上隐藏 'charts byTradingView' 文本
    "dont_show_boolean_study_arguments", //是否隐藏指标参数
    "hide_last_na_study_output", //隐藏最后一次指标输出
    "move_logo_to_main_pane", //logo在中间位置
    "same_data_requery", //允许您使用相同的商品调用 setSymbol 来刷新数据
    "hide_left_toolbar_by_default", //第一次打开图表时隐藏左工具栏
    "side_toolbar_in_fullscreen_mode", //使用此功能,您可以在全屏模式下启用绘图工具栏
    "disable_resolution_rebuild", //显示的时间与得到的数据时间一致
    "seconds_resolution",//支持秒的周期
    'hide_last_na_study_output', // 隐藏指标后面的 n/a
    "remove_library_container_border",
    "constraint_dialogs_movement",//todo: nie do końca jestem pewien
    
  ],
  overrides:{
    "symbolWatermarkProperties.color": color.Kbg,
      "paneProperties.background": color.Kbg,
      "paneProperties.vertGridProperties.color": color.KGridLines,
      "paneProperties.horzGridProperties.color": color.KGridLines,
      "paneProperties.crossHairProperties.color": color.KMouse,
      "paneProperties.crossHairProperties.style": 2,
      // 数据列风格。 请参阅下面的支持的值
      //  Bars = 0            #美国线
      //  Candles = 1         #K线图
      //  Line = 2            #线形图
      //  Area = 3            #面积图
      //  Heiken Ashi = 8     #平均K线图
      //  Hollow Candles = 9  #空心K线图
      //  Renko = 4           #转形图
      //  Kagi = 5            #卡吉图
      //  Point&Figure = 6    #点数图
      //  Line Break = 7      #新价图
      "mainSeriesProperties.style": 1,
      "mainSeriesProperties.showCountdown": false,
      "scalesProperties.showSeriesLastValue": true,
      "mainSeriesProperties.visible": false,
      "mainSeriesProperties.showPriceLine": true,
      "mainSeriesProperties.priceLineWidth": 1,
      "mainSeriesProperties.lockScale": false,
      "mainSeriesProperties.minTick": "default",
      "mainSeriesProperties.extendedHours": false,
      "volumePaneSize": "medium",//底部视图大小 支持的值: large, medium, small, tiny
      editorFontsList: ["Lato", "Arial", "Verdana", "Courier New", "Times New Roman"],
      "paneProperties.topMargin": 5,
      "paneProperties.bottomMargin": 5,
      "paneProperties.legendProperties.showLegend": true, //收起左上角指标
      "paneProperties.leftAxisProperties.autoScale": true,
      "paneProperties.leftAxisProperties.autoScaleDisabled": false,
      "paneProperties.leftAxisProperties.percentage": false,
      "paneProperties.leftAxisProperties.percentageDisabled": false,
      "paneProperties.leftAxisProperties.log": false,
      "paneProperties.leftAxisProperties.logDisabled": false,
      "paneProperties.leftAxisProperties.alignLabels": true,
      "paneProperties.legendProperties.showStudyArguments": true,
      "paneProperties.legendProperties.showStudyTitles": false,//MA为名字
      "paneProperties.legendProperties.showStudyValues": true,
      "paneProperties.legendProperties.showSeriesTitle": false,//商品名称
      "paneProperties.legendProperties.showSeriesOHLC": true,//开高低
      "scalesProperties.showLeftScale": false,
      "scalesProperties.showRightScale": true,
      "scalesProperties.backgroundColor": color.KCoordinate,
      "scalesProperties.lineColor": color.KCoordinate,
      "scalesProperties.textColor": color.Kfont,
      "scalesProperties.scaleSeriesOnly": false,
      "mainSeriesProperties.priceAxisProperties.autoScale": true,
      "mainSeriesProperties.priceAxisProperties.autoScaleDisabled": false,
      "mainSeriesProperties.priceAxisProperties.percentage": false,
      "mainSeriesProperties.priceAxisProperties.percentageDisabled": false,
      "mainSeriesProperties.priceAxisProperties.log": false,
      "mainSeriesProperties.priceAxisProperties.logDisabled": false,
      "mainSeriesProperties.candleStyle.upColor": color.KbGreen,
      "mainSeriesProperties.candleStyle.downColor": color.KbRed,
      "mainSeriesProperties.candleStyle.drawWick": true,
      "mainSeriesProperties.candleStyle.drawBorder": true,
      "mainSeriesProperties.candleStyle.borderUpColor": color.KbGreen,
      "mainSeriesProperties.candleStyle.borderDownColor": color.KbRed,
      "mainSeriesProperties.candleStyle.wickUpColor": color.KbGreen,
      "mainSeriesProperties.candleStyle.wickDownColor": color.KbRed,
      "mainSeriesProperties.candleStyle.barColorsOnPrevClose": false,
      "mainSeriesProperties.hollowCandleStyle.upColor": color.KbGreen,
      "mainSeriesProperties.hollowCandleStyle.downColor": color.KbRed,
      "mainSeriesProperties.hollowCandleStyle.drawWick": true,
      "mainSeriesProperties.hollowCandleStyle.drawBorder": true,
      "mainSeriesProperties.hollowCandleStyle.borderColor": color.KbGreen,
      "mainSeriesProperties.hollowCandleStyle.borderUpColor": color.KbGreen,
      "mainSeriesProperties.hollowCandleStyle.borderDownColor": color.KbRed,
      "mainSeriesProperties.hollowCandleStyle.wickUpColor": color.KbGreen,
      "mainSeriesProperties.hollowCandleStyle.wickDownColor": color.KbRed,
      "mainSeriesProperties.haStyle.upColor": color.KbGreen,
      "mainSeriesProperties.haStyle.downColor": color.KbRed,
      "mainSeriesProperties.haStyle.drawWick": true,
      "mainSeriesProperties.haStyle.drawBorder": true,
      "mainSeriesProperties.haStyle.borderColor": color.KbGreen,
      "mainSeriesProperties.haStyle.borderUpColor": color.KbGreen,
      "mainSeriesProperties.haStyle.borderDownColor": color.KbRed,
      "mainSeriesProperties.haStyle.wickUpColor": color.KbGreen,
      "mainSeriesProperties.haStyle.wickDownColor": color.KbRed,
      "mainSeriesProperties.haStyle.barColorsOnPrevClose": false,
      "mainSeriesProperties.barStyle.upColor": color.KbGreen,
      "mainSeriesProperties.barStyle.downColor": color.KbRed,
      "mainSeriesProperties.barStyle.barColorsOnPrevClose": false,
      "mainSeriesProperties.barStyle.dontDrawOpen": false,
      "mainSeriesProperties.lineStyle.color": color.KCoordinate,
      "mainSeriesProperties.lineStyle.linestyle": 0,
      "mainSeriesProperties.lineStyle.linewidth": 1,
      "mainSeriesProperties.lineStyle.priceSource": "close",

      "mainSeriesProperties.areaStyle.color1": color.KgArea2,
      "mainSeriesProperties.areaStyle.color2": color.KgArea1,
      "mainSeriesProperties.areaStyle.linecolor": color.KbArea,
      "mainSeriesProperties.areaStyle.linestyle": 0,
      "mainSeriesProperties.areaStyle.linewidth": 1,
      "mainSeriesProperties.areaStyle.priceSource": "close",
      "mainSeriesProperties.areaStyle.transparency": 80,
  }
  
}


export default data;
dark_professional.js
const color = {
  //整体背景色
  Kbg:"#171B2B",
  //亮红色
  KbRed:"#FA5252",
  //亮绿色
  KbGreen:"#12B886",
  //暗红色
  KdRed:"#662F39",
  //暗绿色
  KdGreen:"#15524B",
  //字体色
  Kfont:"#B2BAD6",
  //选中字体色
  KSFont:"#3C68E9",
  //选中背景色
  KSBg:"#FA5252",
  //坐标轴色
  KCoordinate:"#49556B",
  //网格线色
  KGridLines:"#1D2131",
  //日线颜色
  KDay:{
    "day5":"#965fc4",
    "day10":"#84aad5",
    "day30":"#55b263",
    "day60":"#b7248a",
  },
  //鼠标虚线颜色
  KMouse:"#c5c6ca",
  //btn字体选中色
  KSBtnFont:"#2483ff",
  //btn背景选中色
  KSBtnBg:"rgba(37,42,68,.5)",
  //btn border
  KSBtnBorder:"#000000",
  //面积图背景色
  KgArea1:"rgba(22,34,53,0.6)",
  KgArea2:"rgba(36,44,61,0.6)",
  //面积图边框色
  KbArea:"#929aa5"
}
const LINESTYLE_SOLID = 0;
const LINESTYLE_DOTTED = 1;
const LINESTYLE_DASHED = 2;
const LINESTYLE_LARGE_DASHED = 3;

const LINEEND_NORMAL = 0;
const LINEEND_ARROW  = 1;
const LINEEND_CIRCLE = 2;

const data = {
  studies_overrides:{
    //柱状图颜色
      "volume.volume.color.0": color.KdRed,  //第一根的颜色
      "volume.volume.color.1": color.KdGreen,  //第二根的颜色
      "volume.volume.transparency": 100,    //透明度
      "volume.volume ma.color": color.KdGreen, //波浪图颜色
      "volume.volume ma.transparency": 1, //波浪图透明度
      "KDay": color.KDay,
  },
  disabled_features:[
    'show_hide_button_in_legend',
    'study_buttons_in_legend',
    'source_selection_markers',
    "header_interval_dialog_button",
    "header_symbol_search",//头部搜索
    "header_saveload",//上传下载
    "header_screenshot",//截图
    "header_chart_type",// k线样式
    "header_undo_redo",//撤销返回
    "timeframes_toolbar",//下面的时间
    "volume_force_overlay",//防止他们重叠
    "header_compare",//图表对比
    "header_resolutions",//todo: przetestowac//头部的时间
    'countdown',//倒计时
    'pane_context_menu',
    'scales_context_menu',

    
    "show_interval_dialog_on_key_press",
    "symbol_search_hot_key",
    "study_dialog_search_control",
    "display_market_status",
    
    
    "symbol_info",//商品信息
    "border_around_the_chart",
    "main_series_scale_menu",
    "star_some_intervals_by_default",
    // "datasource_copypaste",
    // "right_bar_stays_on_scroll",

    "go_to_date",
    "compare_symbol",
    "border_around_the_chart",
    "timezone_menu",
    
    'chart_property_page_style',
    "control_bar",//todo: przetestowac
    "remove_library_container_border",
    "save_chart_properties_to_local_storage",//可以禁用以禁止将图表属性存储到 localstorage
    "items_favoriting",//禁用此功能会隐藏所有“收藏此项目”按钮
  ],
  enabled_features:[
    "adaptive_logo", //小屏幕上隐藏 'charts byTradingView' 文本
    "hide_last_na_study_output", //隐藏最后一次指标输出
    "move_logo_to_main_pane", //logo在中间位置
    "same_data_requery", //允许您使用相同的商品调用 setSymbol 来刷新数据
    // "hide_left_toolbar_by_default", //第一次打开图表时隐藏左工具栏
    "side_toolbar_in_fullscreen_mode", //使用此功能,您可以在全屏模式下启用绘图工具栏
    "disable_resolution_rebuild", //显示的时间与得到的数据时间一致
    "seconds_resolution",//支持秒的周期
    'hide_last_na_study_output', // 隐藏指标后面的 n/a
    "remove_library_container_border",
    "constraint_dialogs_movement",//todo: nie do końca jestem pewien
    
  ],

  overrides:{
    "symbolWatermarkProperties.color": color.Kbg,
    "paneProperties.background": color.Kbg,
    "paneProperties.vertGridProperties.color": color.KGridLines,
    "paneProperties.horzGridProperties.color": color.KGridLines,
    "paneProperties.crossHairProperties.color": color.KMouse,
    "paneProperties.crossHairProperties.style": 2,
    // 数据列风格。 请参阅下面的支持的值
    //  Bars = 0            #美国线
    //  Candles = 1         #K线图
    //  Line = 2            #线形图
    //  Area = 3            #面积图
    //  Heiken Ashi = 8     #平均K线图
    //  Hollow Candles = 9  #空心K线图
    //  Renko = 4           #转形图
    //  Kagi = 5            #卡吉图
    //  Point&Figure = 6    #点数图
    //  Line Break = 7      #新价图
    // "mainSeriesProperties.style": 1,
    // "mainSeriesProperties.showCountdown": false,
    // "scalesProperties.showSeriesLastValue": true,
    "mainSeriesProperties.visible": false,
    "mainSeriesProperties.showPriceLine": true,
    "mainSeriesProperties.priceLineWidth": 1,
    "mainSeriesProperties.lockScale": false,
    "mainSeriesProperties.minTick": "default",
    "mainSeriesProperties.extendedHours": false,
    "volumePaneSize": "medium",//底部视图大小 支持的值: large, medium, small, tiny
    editorFontsList: ["Lato", "Arial", "Verdana", "Courier New", "Times New Roman"],
    "paneProperties.topMargin": 5,
    "paneProperties.bottomMargin": 5,
    "paneProperties.leftAxisProperties.autoScale": false,
    "paneProperties.leftAxisProperties.autoScaleDisabled": false,
    "paneProperties.leftAxisProperties.percentage": false,
    "paneProperties.leftAxisProperties.percentageDisabled": false,
    "paneProperties.leftAxisProperties.log": false,
    "paneProperties.leftAxisProperties.logDisabled": false,
    "paneProperties.leftAxisProperties.alignLabels": true,
    "paneProperties.legendProperties.showStudyArguments": true,
    "paneProperties.legendProperties.showStudyTitles": true,
    "paneProperties.legendProperties.showStudyValues": true,
    "paneProperties.legendProperties.showSeriesTitle": true,
    "paneProperties.legendProperties.showSeriesOHLC": true,//开高低
    "paneProperties.legendProperties.showLegend": true, //收起左上角指标
    "scalesProperties.showLeftScale": false,
    "scalesProperties.showRightScale": true,
    "scalesProperties.backgroundColor": color.KCoordinate,
    "scalesProperties.lineColor": color.KCoordinate,
    "scalesProperties.textColor": color.Kfont,
    "scalesProperties.scaleSeriesOnly": false,
    "mainSeriesProperties.priceAxisProperties.autoScale": false,
    "mainSeriesProperties.priceAxisProperties.autoScaleDisabled": false,
    "mainSeriesProperties.priceAxisProperties.percentage": false,
    "mainSeriesProperties.priceAxisProperties.percentageDisabled": false,
    "mainSeriesProperties.priceAxisProperties.log": false,
    "mainSeriesProperties.priceAxisProperties.logDisabled": false,
    "mainSeriesProperties.candleStyle.upColor": color.KbGreen,
    "mainSeriesProperties.candleStyle.downColor": color.KbRed,
    "mainSeriesProperties.candleStyle.drawWick": true,
    "mainSeriesProperties.candleStyle.drawBorder": true,
    "mainSeriesProperties.candleStyle.borderUpColor": color.KbGreen,
    "mainSeriesProperties.candleStyle.borderDownColor": color.KbRed,
    "mainSeriesProperties.candleStyle.wickUpColor": color.KbGreen,
    "mainSeriesProperties.candleStyle.wickDownColor": color.KbRed,
    "mainSeriesProperties.candleStyle.barColorsOnPrevClose": false,
    "mainSeriesProperties.hollowCandleStyle.upColor": color.KbGreen,
    "mainSeriesProperties.hollowCandleStyle.downColor": color.KbRed,
    "mainSeriesProperties.hollowCandleStyle.drawWick": true,
    "mainSeriesProperties.hollowCandleStyle.drawBorder": true,
    "mainSeriesProperties.hollowCandleStyle.borderColor": color.KbGreen,
    "mainSeriesProperties.hollowCandleStyle.borderUpColor": color.KbGreen,
    "mainSeriesProperties.hollowCandleStyle.borderDownColor": color.KbRed,
    "mainSeriesProperties.hollowCandleStyle.wickUpColor": color.KbGreen,
    "mainSeriesProperties.hollowCandleStyle.wickDownColor": color.KbRed,
    "mainSeriesProperties.haStyle.upColor": color.KbGreen,
    "mainSeriesProperties.haStyle.downColor": color.KbRed,
    "mainSeriesProperties.haStyle.drawWick": true,
    "mainSeriesProperties.haStyle.drawBorder": true,
    "mainSeriesProperties.haStyle.borderColor": color.KbGreen,
    "mainSeriesProperties.haStyle.borderUpColor": color.KbGreen,
    "mainSeriesProperties.haStyle.borderDownColor": color.KbRed,
    "mainSeriesProperties.haStyle.wickUpColor": color.KbGreen,
    "mainSeriesProperties.haStyle.wickDownColor": color.KbRed,
    "mainSeriesProperties.haStyle.barColorsOnPrevClose": false,
    "mainSeriesProperties.barStyle.upColor": color.KbGreen,
    "mainSeriesProperties.barStyle.downColor": color.KbRed,
    "mainSeriesProperties.barStyle.barColorsOnPrevClose": false,
    "mainSeriesProperties.barStyle.dontDrawOpen": false,
    "mainSeriesProperties.lineStyle.color": color.KCoordinate,
    "mainSeriesProperties.lineStyle.linestyle": 0,
    "mainSeriesProperties.lineStyle.linewidth": 1,
    "mainSeriesProperties.lineStyle.priceSource": "close",

    
    "mainSeriesProperties.areaStyle.color1": color.KgArea2,
    "mainSeriesProperties.areaStyle.color2": color.KgArea1,
    "mainSeriesProperties.areaStyle.linecolor": color.KbArea,
    "mainSeriesProperties.areaStyle.linestyle": 0,
    "mainSeriesProperties.areaStyle.linewidth": 1,
    "mainSeriesProperties.areaStyle.priceSource": "close",
    "mainSeriesProperties.areaStyle.transparency": 80,
}
  


}


export default data;
dark_simple.js
const color = {
  //整体背景色
  Kbg:"#171B2B",
  //亮红色
  KbRed:"#ff575c",
  //亮绿色
  KbGreen:"#3dcc89",
  //暗红色
  KdRed:"#ff575c",
  //暗绿色
  KdGreen:"#3dcc89",
  //字体色
  Kfont:"#B2BAD6",
  //选中字体色
  KSFont:"#3C68E9",
  //选中背景色
  KSBg:"#FA5252",
  //坐标轴色
  KCoordinate:"#49556B",
  //网格线色
  KGridLines:"#1D2131",
  //日线颜色
  KDay:{
    "day5":"rgb(240,185,11)",
    "day10":"rgb(16,170,8)",
    "day30":"rgb(255,0,255)",
  },
  //鼠标虚线颜色
  KMouse:"#c5c6ca",
  //btn字体选中色
  KSBtnFont:"#2483ff",
  //btn背景选中色
  KSBtnBg:"rgba(37,42,68,.5)",
  //btn border
  KSBtnBorder:"#000000",
  //面积图背景色
  KgArea1:"rgba(22,34,53,0.6)",
  KgArea2:"rgba(36,44,61,0.6)",
  //面积图边框色
  KbArea:"#929aa5"
}

const data = {
  studies_overrides:{
    //柱状图颜色
    "volume.volume.color.0": color.KdRed,  //第一根的颜色
    "volume.volume.color.1": color.KdGreen,  //第二根的颜色
    "volume.volume.transparency": 0,    //透明度
    "volume.volume ma.color": "#FFFFFF", //波浪图颜色
    "volume.volume ma.transparency": 0, //波浪图透明度
    "KDay": color.KDay,    
    // "volume.show ma": true,    //是否显示
    // "volume.options.showStudyArguments": true,
    // "bollinger bands.median.color": "#33FF88",
    // "bollinger bands.upper.linewidth": 7,
    // // MACD样式
    // "MACD.MACD.color": "#F00",
    // "MACD.Signal.color": "#fe8",
    // "MACD.Histogram.color": "#0f0",
    // 'MACD.MACD.linewidth': 1,

  },
  disabled_features:[
    'property_pages',
    "left_toolbar",//左部工具栏
    'header_settings',//指标
    'header_fullscreen_button',//全屏
    'legend_context_menu',
    'context_menus',
    'header_indicators',
    "edit_buttons_in_legend",
    // 'legend_widget',
    'format_button_in_legend',
    'delete_button_in_legend',

    'show_hide_button_in_legend',
    'study_buttons_in_legend',
    'source_selection_markers',
    "header_interval_dialog_button",
    "header_symbol_search",//头部搜索
    "header_saveload",//上传下载
    "header_screenshot",//截图
    "header_chart_type",// k线样式
    "header_undo_redo",//撤销返回
    "timeframes_toolbar",//下面的时间
    "volume_force_overlay",//防止他们重叠
    "header_compare",//图表对比
    "header_resolutions",//todo: przetestowac//头部的时间
    'countdown',//倒计时
    'pane_context_menu',
    'scales_context_menu',

    
    "show_interval_dialog_on_key_press",
    "symbol_search_hot_key",
    "study_dialog_search_control",
    "display_market_status",
    
    
    "symbol_info",//商品信息
    "border_around_the_chart",
    "main_series_scale_menu",
    "star_some_intervals_by_default",
    "datasource_copypaste",
    // "right_bar_stays_on_scroll",

    "go_to_date",
    "compare_symbol",
    "border_around_the_chart",
    "timezone_menu",
    
    'chart_property_page_style',
    "control_bar",//todo: przetestowac
    "remove_library_container_border",
  ],
  enabled_features:[
    "adaptive_logo", //小屏幕上隐藏 'charts byTradingView' 文本
    "dont_show_boolean_study_arguments", //是否隐藏指标参数
    "move_logo_to_main_pane", //logo在中间位置
    "same_data_requery", //允许您使用相同的商品调用 setSymbol 来刷新数据
    "side_toolbar_in_fullscreen_mode", //使用此功能,您可以在全屏模式下启用绘图工具栏
    "disable_resolution_rebuild", //显示的时间与得到的数据时间一致
    "seconds_resolution",//支持秒的周期
    'hide_last_na_study_output', // 隐藏指标后面的 n/a
    "remove_library_container_border",
    "constraint_dialogs_movement",//todo: nie do końca jestem pewien
    
  ],
  overrides:{
    "symbolWatermarkProperties.color": color.Kbg,
    "paneProperties.background": color.Kbg,
    "paneProperties.vertGridProperties.color": color.KGridLines,
    "paneProperties.horzGridProperties.color": color.KGridLines,
    "paneProperties.crossHairProperties.color": color.KMouse,
    "paneProperties.crossHairProperties.style": 2,
    // 数据列风格。 请参阅下面的支持的值
    //  Bars = 0            #美国线
    //  Candles = 1         #K线图
    //  Line = 2            #线形图
    //  Area = 3            #面积图
    //  Heiken Ashi = 8     #平均K线图
    //  Hollow Candles = 9  #空心K线图
    //  Renko = 4           #转形图
    //  Kagi = 5            #卡吉图
    //  Point&Figure = 6    #点数图
    //  Line Break = 7      #新价图
    "mainSeriesProperties.style": 1,
    "mainSeriesProperties.showCountdown": false,
    "scalesProperties.showSeriesLastValue": true,
    "mainSeriesProperties.visible": false,
    "mainSeriesProperties.showPriceLine": true,
    "mainSeriesProperties.priceLineWidth": 1,
    "mainSeriesProperties.lockScale": false,
    "mainSeriesProperties.minTick": "default",
    "mainSeriesProperties.extendedHours": false,
    "volumePaneSize": "medium",//底部视图大小 支持的值: large, medium, small, tiny
    "editorFontsList": ["Lato", "Arial", "Verdana", "Courier New", "Times New Roman"],
    "paneProperties.topMargin": 5,
    "paneProperties.bottomMargin": 5,
    "paneProperties.legendProperties.showLegend": true, //收起左上角指标
    "paneProperties.leftAxisProperties.autoScale": false,
    "paneProperties.leftAxisProperties.autoScaleDisabled": false,
    "paneProperties.leftAxisProperties.percentage": false,
    "paneProperties.leftAxisProperties.percentageDisabled": false,
    "paneProperties.leftAxisProperties.log": false,
    "paneProperties.leftAxisProperties.logDisabled": false,
    "paneProperties.leftAxisProperties.alignLabels": true,
    "paneProperties.legendProperties.showStudyArguments": true,
    "paneProperties.legendProperties.showStudyTitles": false,//MA为名字
    "paneProperties.legendProperties.showStudyValues": true,
    "paneProperties.legendProperties.showSeriesTitle": false,//商品名称
    "paneProperties.legendProperties.showSeriesOHLC": true,//开高低
    "scalesProperties.showLeftScale": false,
    "scalesProperties.showRightScale": true,
    "scalesProperties.backgroundColor": color.KCoordinate,
    "scalesProperties.lineColor": color.KCoordinate,
    "scalesProperties.textColor": color.Kfont,
    "scalesProperties.scaleSeriesOnly": false,
    "mainSeriesProperties.priceAxisProperties.autoScale": false,
    "mainSeriesProperties.priceAxisProperties.autoScaleDisabled": false,
    "mainSeriesProperties.priceAxisProperties.percentage": false,
    "mainSeriesProperties.priceAxisProperties.percentageDisabled": false,
    "mainSeriesProperties.priceAxisProperties.log": false,
    "mainSeriesProperties.priceAxisProperties.logDisabled": false,
    "mainSeriesProperties.candleStyle.upColor": color.KbGreen,
    "mainSeriesProperties.candleStyle.downColor": color.KbRed,
    "mainSeriesProperties.candleStyle.drawWick": true,
    "mainSeriesProperties.candleStyle.drawBorder": true,
    "mainSeriesProperties.candleStyle.borderUpColor": color.KbGreen,
    "mainSeriesProperties.candleStyle.borderDownColor": color.KbRed,
    "mainSeriesProperties.candleStyle.wickUpColor": color.KbGreen,
    "mainSeriesProperties.candleStyle.wickDownColor": color.KbRed,
    "mainSeriesProperties.candleStyle.barColorsOnPrevClose": false,
    "mainSeriesProperties.hollowCandleStyle.upColor": color.KbGreen,
    "mainSeriesProperties.hollowCandleStyle.downColor": color.KbRed,
    "mainSeriesProperties.hollowCandleStyle.drawWick": true,
    "mainSeriesProperties.hollowCandleStyle.drawBorder": true,
    "mainSeriesProperties.hollowCandleStyle.borderColor": color.KbGreen,
    "mainSeriesProperties.hollowCandleStyle.borderUpColor": color.KbGreen,
    "mainSeriesProperties.hollowCandleStyle.borderDownColor": color.KbRed,
    "mainSeriesProperties.hollowCandleStyle.wickUpColor": color.KbGreen,
    "mainSeriesProperties.hollowCandleStyle.wickDownColor": color.KbRed,
    "mainSeriesProperties.haStyle.upColor": color.KbGreen,
    "mainSeriesProperties.haStyle.downColor": color.KbRed,
    "mainSeriesProperties.haStyle.drawWick": true,
    "mainSeriesProperties.haStyle.drawBorder": true,
    "mainSeriesProperties.haStyle.borderColor": color.KbGreen,
    "mainSeriesProperties.haStyle.borderUpColor": color.KbGreen,
    "mainSeriesProperties.haStyle.borderDownColor": color.KbRed,
    "mainSeriesProperties.haStyle.wickUpColor": color.KbGreen,
    "mainSeriesProperties.haStyle.wickDownColor": color.KbRed,
    "mainSeriesProperties.haStyle.barColorsOnPrevClose": false,
    "mainSeriesProperties.barStyle.upColor": color.KbGreen,
    "mainSeriesProperties.barStyle.downColor": color.KbRed,
    "mainSeriesProperties.barStyle.barColorsOnPrevClose": false,
    "mainSeriesProperties.barStyle.dontDrawOpen": false,
    "mainSeriesProperties.lineStyle.color": color.KCoordinate,
    "mainSeriesProperties.lineStyle.linestyle": 0,
    "mainSeriesProperties.lineStyle.linewidth": 1,
    "mainSeriesProperties.lineStyle.priceSource": "close",

    
    "mainSeriesProperties.areaStyle.color1": color.KgArea2,
    "mainSeriesProperties.areaStyle.color2": color.KgArea1,
    "mainSeriesProperties.areaStyle.linecolor": color.KbArea,
    "mainSeriesProperties.areaStyle.linestyle": 0,
    "mainSeriesProperties.areaStyle.linewidth": 1,
    "mainSeriesProperties.areaStyle.priceSource": "close",
    "mainSeriesProperties.areaStyle.transparency": 80,
}

  
}


export default data;
tabs.js
export default [
{
    value: "1min",
    period: "1",
    text: "Time",
    chartType: 3,
    type: "min",
  },
  {
    value: "1",
    period: "1m",
    text: "1min",
    chartType: 1,
    type: "1min",
  },
  {
    value: "5",
    period: "5m",
    text: "5min",
    chartType: 1,
    type: "5min",
  },
  {
  	value: "15",
  	period: "15m",
  	text: "15min",
  	chartType: 1,
  	type:"15min"
  },
  {
    value: "30",
    period: "30m",
    text: "30min",
    chartType: 1,
    type: "30min",
  },
  {
    value: "60",
    period: "60分",
    text: "1h",
    chartType: 1,
    type: "60min",
  },
  {
    value: "240",
    period: "240分",
    text: "4h",
    chartType: 1,
    type: "4hour",
  },
  {
    value: "1D",
    period: "1D",
    text: "1day",
    chartType: 1,
    type: "1day",
  },
  {
    value: "1W",
    period: "1W",
    text: "1week",
    chartType: 1,
    type: "1week",
  },
  {
    value: "1M",
    period: "1M",
    text: "1mon",
    chartType: 1,
    type: "1mon",
  },
];

猜你喜欢

转载自blog.csdn.net/qq_39664702/article/details/113932696