MACD知识入门

百度百科对MACD的定义:

  • MACD称为指数平滑移动平均线,是从双指数移动平均线发展而来的,由快的指数移动平均线(EMA12)减去慢的指数移动平均线(EMA26)得到快线DIF,再用2×(快线DIF-DIF的9日加权移动均线DEA)得到MACD柱。MACD的意义和双移动平均线基本相同,即由快、慢均线的离散、聚合表征当前的多空状态和股价可能的发展变化趋势,但阅读起来更方便。

EMA

  • EMA即英文Exponential Moving Average的缩写,即指数移动平均指标,也叫EXPMA指标。

  • EMA的定义为,当日EMA等于当日收盘价减去昨日EMA之后乘以平滑系数,然后再加上昨日的EMA

    EMA(N) = C * 2/(N+1) + EMA' * (N-1)/(N+1)

由上面的公式可以得出EMA12和EMA26的计算公式

    EMA(12) = C * 2/(12+1) + EMA' * (12-1)/(12+1)

EMA(26) = C * 2/(26+1) + EMA' * (26-1)/(26+1)

假设要计算从股票上市起第n日的EMA,计为EMAn则有:

平滑系数:

最终精简公式为:

DIF

DIF=EMA(12)- EMA(26)

新股上市首日,其首日DIF为0。从次日开始,全部都用当天的EMA(12)- EMA(26)得到当天的DIF。

DEA

DEA通用公式:

MACD指标公式及其分解-网上其他资料几乎全是错的
DEA’表示昨日的DEA。

这个公式可以模仿普通EMA的展开式展开,这里不再详述。

默认的DEA即DIF线的9日指数平滑移动平均线,也可以表示为MEA(DIF,9)。

MACD指标公式及其分解-网上其他资料几乎全是错的
新股上市首日,其首日DEA为0。从次日开始,由于首日DEA为0,因此次日的DEA=0.2* DIF+0=0.2DIF。后续日子的DEA可以套用0.2DIF + 0.8* DEA’计算。

BAR

BAR=2* (DIF-DEA)

[引用]

  1. 关于MACD公式介绍

MACD js实践

MACD.js

function EMA(fNow,fPre,N){
    return Number((fNow * 2 / (N + 1) + fPre * (N - 1) / (N + 1)).toFixed(2));
}

  /**
   * 计算EMA12和EMA26
   */
  function EMASL(points,N){
    if (points == null || points.length <= 0 || N == 0)
      return new Array();
    let result = new Array();
    for(let i=0;i<points.length;i++){
      let candle = points[i];
      if(i == 0){//第一天的EMA为收盘价
        result.push(points[i].c);
      }else{
        result.push(EMA(points[i].c,result[i-1],N));
      }
    }
    return result;
  }

  function DIF(points){
    if (points == null || points.length <= 0)
      return new Array();
    let EMAS = EMASL(points,12);
    let EMAL = EMASL(points,26);
    let DIFs = new Array();
    for(let i =0;i<EMAL.length;i++){
      DIFs.push(formartNumber(EMAS[i]-EMAL[i]));
    }
    return DIFs;
  }

  function DEA(points,N){
    if (points == null || points.length <= 0)
      return new Array();
    let dif = DIF(points);
    let result = new Array();
    for(let i=0;i<points.length;i++){
      if(i == 0){
        result.push(0);
      }else{
        result.push(EMA(dif[i],result[i-1],N));
      }
    }
    return result;
  }

  function BAR(points){
    if (points == null || points.length <= 0)
      return new Array();
    let dif = DIF(points);
    let dea = DEA(points,9);
    let bar = new Array();
    for(let i=0;i<points.length;i++){
      bar.push(2*(formartNumber(dif[i]-dea[i])));
    }
    return bar;
  }

  function formartNumber(n){
      return Number(n.toFixed(2));
  }

MACD.html

<head>
    <title>MEDAtitle>
    <script src="data.js">script>
    <script src="MEDA.js">script>
    <script src="https://cdn.hcharts.cn/highcharts/highcharts.js">script>
head>
<body>

    <div id="container" style="min-width:800px;height:400px">div>
<script type="text/javascript">
    let num = 1.123;
    alert(typeof num.toFixed(2));

    let EMAS = EMASL(json,12);
    let EMAL = EMASL(json,26);

    // console.log(EMAS);
    // console.log(EMAL);

    let dif = DIF(json);

    console.log(dif);


    let dea = DEA(json,9);

    console.log(dea);

    let bar = BAR(json);
    // console.log(bar);

    let time = [];
    for(let i=0;i<json.length;i++){
        time.push(json[i].trddate);
    }

    var chart = new Highcharts.Chart('container', {// 图表初始化函数,其中 container 为图表的容器 div               
    chart: {
        type: 'line',
        backgroundColor:'#323749',
        height: '470px'
                                   //指定图表的类型,默认是折线图(line)
    },
    title: {
        text: 'MACD'                 //指定图表标题
    },
    xAxis: {
       lineColor: '#5C6475',
        lineWidth: 0.5,
        tickColor:'#5C6475',
        categories:time
    },
    yAxis: {
        title: {
            text: 'MACD'                 //指定y轴的标题
        },
        gridLineColor: '#5C6475',
        gridLineWidth: 0.5
    },
    series: [{                                 //指定数据列
        name: 'DIF',                          //数据列名
        data: dif,
        // color:'#ffff00',
        color:'#ffffff',
        marker: {
          enabled: false,
        }                       //数据
    }, {
        name: 'DEA',
        data: dea,
        color:'#ffff00',
        marker: {
          enabled: false,
        }
    }
    ,{
        name:'BAR',
        data:bar,
        color:'#ffffff',
        marker: {
           enabled: false,
        }
     }
    ]
});
script>
body>
html>

data.js

var jsonstr = '[{"tdate":20170103,"c":45760,"t":0,"v":183888,"dtime":"1519","h":46290,"oi":0,"l":45630,"vs":"183888","o":45630,"trddate":20170103},{"tdate":20170104,"c":45520,"t":0,"v":290606,"dtime":"1517","h":45980,"oi":0,"l":44810,"vs":"290606","o":45910,"trddate":20170104},{"tdate":20170105,"c":45760,"t":0,"v":318430,"dtime":"1518","h":46170,"oi":0,"l":45360,"vs":"318430","o":45400,"trddate":20170105},{"tdate":20170106,"c":45350,"t":0,"v":252160,"dtime":"1517","h":45770,"oi":0,"l":45090,"vs":"252160","o":45720,"trddate":20170106},{"tdate":20170109,"c":45730,"t":0,"v":201880,"dtime":"1515","h":45770,"oi":0,"l":45090,"vs":"201880","o":45260,"trddate":20170109},{"tdate":20170110,"c":46110,"t":0,"v":310498,"dtime":"1519","h":46270,"oi":0,"l":45350,"vs":"310498","o":45530,"trddate":20170110},{"tdate":20170111,"c":47160,"t":0,"v":371356,"dtime":"1500","h":47260,"oi":0,"l":46340,"vs":"371356","o":46340,"trddate":20170111},{"tdate":20170112,"c":46980,"t":0,"v":289596,"dtime":"1500","h":47200,"oi":0,"l":46750,"vs":"289596","o":46950,"trddate":20170112},{"tdate":20170113,"c":47400,"t":0,"v":362068,"dtime":"1521","h":47810,"oi":0,"l":47110,"vs":"362068","o":47110,"trddate":20170113},{"tdate":20170116,"c":47950,"t":0,"v":355334,"dtime":"1515","h":48390,"oi":0,"l":47230,"vs":"355334","o":47420,"trddate":20170116},{"tdate":20170117,"c":46780,"t":0,"v":303912,"dtime":"1521","h":48060,"oi":0,"l":46540,"vs":"303912","o":47880,"trddate":20170117},{"tdate":20170118,"c":46600,"t":0,"v":308372,"dtime":"1519","h":47060,"oi":0,"l":45930,"vs":"308372","o":46850,"trddate":20170118},{"tdate":20170119,"c":46730,"t":0,"v":208420,"dtime":"1515","h":46880,"oi":0,"l":46290,"vs":"208420","o":46500,"trddate":20170119},{"tdate":20170120,"c":46080,"t":0,"v":236030,"dtime":"1514","h":46730,"oi":0,"l":46000,"vs":"236030","o":46570,"trddate":20170120},{"tdate":20170123,"c":46850,"t":0,"v":240234,"dtime":"1518","h":47280,"oi":0,"l":46140,"vs":"240234","o":46270,"trddate":20170123},{"tdate":20170124,"c":47070,"t":0,"v":187382,"dtime":"1518","h":47210,"oi":0,"l":46500,"vs":"187382","o":46810,"trddate":20170124},{"tdate":20170125,"c":47650,"t":0,"v":197238,"dtime":"1522","h":47880,"oi":0,"l":47370,"vs":"197238","o":47480,"trddate":20170125},{"tdate":20170126,"c":48040,"t":0,"v":188630,"dtime":"1500","h":48210,"oi":0,"l":47450,"vs":"188630","o":47460,"trddate":20170126},{"tdate":20170203,"c":46780,"t":0,"v":119846,"dtime":"1514","h":47710,"oi":0,"l":46520,"vs":"119846","o":47700,"trddate":20170203},{"tdate":20170206,"c":46600,"t":0,"v":145150,"dtime":"1516","h":46980,"oi":0,"l":46300,"vs":"145150","o":46810,"trddate":20170206},{"tdate":20170207,"c":46850,"t":0,"v":129254,"dtime":"1525","h":47060,"oi":0,"l":46560,"vs":"129254","o":46620,"trddate":20170207},{"tdate":20170208,"c":47660,"t":0,"v":185624,"dtime":"1515","h":47690,"oi":0,"l":46530,"vs":"185624","o":46800,"trddate":20170208},{"tdate":20170209,"c":47590,"t":0,"v":108768,"dtime":"1516","h":47950,"oi":0,"l":47370,"vs":"108768","o":47710,"trddate":20170209},{"tdate":20170210,"c":47820,"t":0,"v":213852,"dtime":"1520","h":48050,"oi":0,"l":47120,"vs":"213852","o":47620,"trddate":20170210},{"tdate":20170213,"c":50120,"t":0,"v":616476,"dtime":"1518","h":50620,"oi":0,"l":47780,"vs":"616476","o":47800,"trddate":20170213},{"tdate":20170214,"c":50110,"t":0,"v":347374,"dtime":"1518","h":50250,"oi":0,"l":49660,"vs":"347374","o":49820,"trddate":20170214},{"tdate":20170215,"c":48740,"t":0,"v":512812,"dtime":"1519","h":50290,"oi":0,"l":48290,"vs":"512812","o":50090,"trddate":20170215},{"tdate":20170216,"c":48680,"t":0,"v":376604,"dtime":"1500","h":49380,"oi":0,"l":48510,"vs":"376604","o":48740,"trddate":20170216},{"tdate":20170217,"c":48360,"t":0,"v":375026,"dtime":"1500","h":48960,"oi":0,"l":48170,"vs":"375026","o":48600,"trddate":20170217},{"tdate":20170220,"c":48770,"t":0,"v":321866,"dtime":"1500","h":48850,"oi":0,"l":47950,"vs":"321866","o":48280,"trddate":20170220},{"tdate":20170221,"c":48920,"t":0,"v":295714,"dtime":"1516","h":49350,"oi":0,"l":48750,"vs":"295714","o":48870,"trddate":20170221},{"tdate":20170222,"c":48660,"t":0,"v":269764,"dtime":"1500","h":49210,"oi":0,"l":48500,"vs":"269764","o":48990,"trddate":20170222},{"tdate":20170223,"c":48390,"t":0,"v":287134,"dtime":"1515","h":48990,"oi":0,"l":48160,"vs":"287134","o":48530,"trddate":20170223},{"tdate":20170224,"c":47760,"t":0,"v":410140,"dtime":"1515","h":48700,"oi":0,"l":47100,"vs":"410140","o":48640,"trddate":20170224},{"tdate":20170227,"c":47730,"t":0,"v":324820,"dtime":"1517","h":48310,"oi":0,"l":47400,"vs":"324820","o":47700,"trddate":20170227},{"tdate":20170228,"c":47740,"t":0,"v":282636,"dtime":"1500","h":48090,"oi":0,"l":47440,"vs":"282636","o":47910,"trddate":20170228},{"tdate":20170301,"c":48650,"t":0,"v":339392,"dtime":"1516","h":48800,"oi":0,"l":47690,"vs":"339392","o":47880,"trddate":20170301},{"tdate":20170302,"c":48690,"t":0,"v":261336,"dtime":"1517","h":49100,"oi":0,"l":48330,"vs":"261336","o":48780,"trddate":20170302},{"tdate":20170303,"c":48280,"t":0,"v":254492,"dtime":"1521","h":48470,"oi":0,"l":47860,"vs":"254492","o":48450,"trddate":20170303},{"tdate":20170306,"c":47890,"t":0,"v":241164,"dtime":"1516","h":48440,"oi":0,"l":47710,"vs":"241164","o":48130,"trddate":20170306},{"tdate":20170307,"c":47720,"t":0,"v":184672,"dtime":"1515","h":47790,"oi":0,"l":47380,"vs":"184672","o":47750,"trddate":20170307},{"tdate":20170308,"c":47300,"t":0,"v":196618,"dtime":"1500","h":47840,"oi":0,"l":47100,"vs":"196618","o":47610,"trddate":20170308},{"tdate":20170309,"c":46570,"t":0,"v":231422,"dtime":"1515","h":47590,"oi":0,"l":46480,"vs":"231422","o":47400,"trddate":20170309},{"tdate":20170310,"c":46650,"t":0,"v":207214,"dtime":"1520","h":46830,"oi":0,"l":46140,"vs":"207214","o":46300,"trddate":20170310},{"tdate":20170313,"c":47560,"t":0,"v":328654,"dtime":"1500","h":47560,"oi":0,"l":46530,"vs":"328654","o":46800,"trddate":20170313},{"tdate":20170314,"c":47360,"t":0,"v":211346,"dtime":"1517","h":47580,"oi":0,"l":47190,"vs":"211346","o":47500,"trddate":20170314},{"tdate":20170315,"c":47670,"t":0,"v":307966,"dtime":"1516","h":47800,"oi":0,"l":46820,"vs":"307966","o":47150,"trddate":20170315},{"tdate":20170316,"c":48160,"t":0,"v":291370,"dtime":"1518","h":48250,"oi":0,"l":47710,"vs":"291370","o":47900,"trddate":20170316},{"tdate":20170317,"c":47740,"t":0,"v":220262,"dtime":"1500","h":48300,"oi":0,"l":47660,"vs":"220262","o":48270,"trddate":20170317},{"tdate":20170320,"c":47980,"t":0,"v":228262,"dtime":"1517","h":48280,"oi":0,"l":47840,"vs":"228262","o":47960,"trddate":20170320},{"tdate":20170321,"c":47290,"t":0,"v":347368,"dtime":"1519","h":48400,"oi":0,"l":47030,"vs":"347368","o":47980,"trddate":20170321},{"tdate":20170322,"c":46660,"t":0,"v":321040,"dtime":"1517","h":47500,"oi":0,"l":46420,"vs":"321040","o":47150,"trddate":20170322},{"tdate":20170323,"c":47120,"t":0,"v":248072,"dtime":"1515","h":47340,"oi":0,"l":46450,"vs":"248072","o":46730,"trddate":20170323},{"tdate":20170324,"c":47100,"t":0,"v":259020,"dtime":"1518","h":47330,"oi":0,"l":46710,"vs":"259020","o":47120,"trddate":20170324},{"tdate":20170327,"c":46260,"t":0,"v":331254,"dtime":"1516","h":47240,"oi":0,"l":46050,"vs":"331254","o":47040,"trddate":20170327},{"tdate":20170328,"c":46740,"t":0,"v":401114,"dtime":"1519","h":47020,"oi":0,"l":45600,"vs":"401114","o":46100,"trddate":20170328},{"tdate":20170329,"c":47530,"t":0,"v":318226,"dtime":"1500","h":47690,"oi":0,"l":46670,"vs":"318226","o":46860,"trddate":20170329},{"tdate":20170330,"c":47460,"t":0,"v":263782,"dtime":"1520","h":47810,"oi":0,"l":47200,"vs":"263782","o":47500,"trddate":20170330},{"tdate":20170331,"c":47750,"t":0,"v":393114,"dtime":"1519","h":48390,"oi":0,"l":47440,"vs":"393114","o":47510,"trddate":20170331},{"tdate":20170405,"c":47420,"t":0,"v":148642,"dtime":"1500","h":47650,"oi":0,"l":46980,"vs":"148642","o":47090,"trddate":20170405},{"tdate":20170406,"c":47810,"t":0,"v":247964,"dtime":"1500","h":48300,"oi":0,"l":47680,"vs":"247964","o":47810,"trddate":20170406},{"tdate":20170407,"c":47130,"t":0,"v":318632,"dtime":"1522","h":48160,"oi":0,"l":46930,"vs":"318632","o":47900,"trddate":20170407},{"tdate":20170410,"c":47050,"t":0,"v":223444,"dtime":"1521","h":47570,"oi":0,"l":46650,"vs":"223444","o":46820,"trddate":20170410},{"tdate":20170411,"c":46580,"t":0,"v":195250,"dtime":"1525","h":47090,"oi":0,"l":46520,"vs":"195250","o":47020,"trddate":20170411},{"tdate":20170412,"c":46230,"t":0,"v":447660,"dtime":"1520","h":47090,"oi":0,"l":46150,"vs":"447660","o":46800,"trddate":20170412},{"tdate":20170413,"c":46480,"t":0,"v":511384,"dtime":"1517","h":46550,"oi":0,"l":45520,"vs":"511384","o":46070,"trddate":20170413},{"tdate":20170414,"c":46110,"t":0,"v":315686,"dtime":"1526","h":46520,"oi":0,"l":45800,"vs":"315686","o":46150,"trddate":20170414},{"tdate":20170417,"c":46480,"t":0,"v":450362,"dtime":"1520","h":47940,"oi":0,"l":45960,"vs":"450362","o":46150,"trddate":20170417},{"tdate":20170418,"c":45850,"t":0,"v":356194,"dtime":"1519","h":46920,"oi":0,"l":45740,"vs":"356194","o":46690,"trddate":20170418},{"tdate":20170419,"c":45840,"t":0,"v":501250,"dtime":"1520","h":46100,"oi":0,"l":45110,"vs":"501250","o":45850,"trddate":20170419},{"tdate":20170420,"c":45560,"t":0,"v":596204,"dtime":"1500","h":46140,"oi":0,"l":44800,"vs":"596204","o":45760,"trddate":20170420},{"tdate":20170421,"c":46030,"t":0,"v":391290,"dtime":"1519","h":46120,"oi":0,"l":45460,"vs":"391290","o":45750,"trddate":20170421},{"tdate":20170424,"c":45910,"t":0,"v":352930,"dtime":"1523","h":46060,"oi":0,"l":45480,"vs":"352930","o":45840,"trddate":20170424},{"tdate":20170425,"c":46030,"t":0,"v":329762,"dtime":"1521","h":46360,"oi":0,"l":45570,"vs":"329762","o":45780,"trddate":20170425},{"tdate":20170426,"c":46230,"t":0,"v":262080,"dtime":"1520","h":46450,"oi":0,"l":45880,"vs":"262080","o":46220,"trddate":20170426},{"tdate":20170427,"c":46290,"t":0,"v":219242,"dtime":"1518","h":46510,"oi":0,"l":46170,"vs":"219242","o":46340,"trddate":20170427},{"tdate":20170428,"c":46330,"t":0,"v":313460,"dtime":"1519","h":46470,"oi":0,"l":45840,"vs":"313460","o":46330,"trddate":20170428},{"tdate":20170502,"c":46790,"t":0,"v":141624,"dtime":"1523","h":47100,"oi":0,"l":46690,"vs":"141624","o":46950,"trddate":20170502},{"tdate":20170503,"c":46580,"t":0,"v":130726,"dtime":"1518","h":46940,"oi":0,"l":46480,"vs":"130726","o":46860,"trddate":20170503},{"tdate":20170504,"c":45180,"t":0,"v":309126,"dtime":"1500","h":45970,"oi":0,"l":45010,"vs":"309126","o":45870,"trddate":20170504},{"tdate":20170505,"c":44980,"t":0,"v":244258,"dtime":"1500","h":45280,"oi":0,"l":44680,"vs":"244258","o":45000,"trddate":20170505},{"tdate":20170508,"c":44670,"t":0,"v":267810,"dtime":"1521","h":45550,"oi":0,"l":44650,"vs":"267810","o":45000,"trddate":20170508},{"tdate":20170509,"c":44730,"t":0,"v":179390,"dtime":"1518","h":44890,"oi":0,"l":44420,"vs":"179390","o":44620,"trddate":20170509},{"tdate":20170510,"c":44860,"t":0,"v":184178,"dtime":"1518","h":45240,"oi":0,"l":44730,"vs":"184178","o":44840,"trddate":20170510},{"tdate":20170511,"c":45270,"t":0,"v":259366,"dtime":"1500","h":45330,"oi":0,"l":44660,"vs":"259366","o":44980,"trddate":20170511},{"tdate":20170512,"c":44930,"t":0,"v":265148,"dtime":"1519","h":45580,"oi":0,"l":44830,"vs":"265148","o":45510,"trddate":20170512},{"tdate":20170515,"c":45430,"t":0,"v":204988,"dtime":"1520","h":45560,"oi":0,"l":44900,"vs":"204988","o":45080,"trddate":20170515},{"tdate":20170516,"c":45170,"t":0,"v":196142,"dtime":"1521","h":45570,"oi":0,"l":45030,"vs":"196142","o":45540,"trddate":20170516},{"tdate":20170517,"c":45390,"t":0,"v":226698,"dtime":"1522","h":45650,"oi":0,"l":45270,"vs":"226698","o":45290,"trddate":20170517},{"tdate":20170518,"c":44960,"t":0,"v":251502,"dtime":"1500","h":45480,"oi":0,"l":44920,"vs":"251502","o":45240,"trddate":20170518},{"tdate":20170519,"c":45300,"t":0,"v":279650,"dtime":"1522","h":45400,"oi":0,"l":44610,"vs":"279650","o":44650,"trddate":20170519},{"tdate":20170522,"c":45800,"t":0,"v":316766,"dtime":"1500","h":46030,"oi":0,"l":45470,"vs":"316766","o":45570,"trddate":20170522},{"tdate":20170523,"c":45770,"t":0,"v":199768,"dtime":"1523","h":46130,"oi":0,"l":45760,"vs":"199768","o":45980,"trddate":20170523},{"tdate":20170525,"c":45970,"t":0,"v":202522,"dtime":"1500","h":46070,"oi":0,"l":45730,"vs":"202522","o":45900,"trddate":20170525},{"tdate":20170531,"c":45230,"t":0,"v":211210,"dtime":"1500","h":45850,"oi":0,"l":45170,"vs":"211210","o":45690,"trddate":20170531},{"tdate":20170601,"c":45350,"t":0,"v":132220,"dtime":"1523","h":45570,"oi":0,"l":45110,"vs":"132220","o":45320,"trddate":20170601},{"tdate":20170602,"c":45380,"t":0,"v":121784,"dtime":"1518","h":45610,"oi":0,"l":45280,"vs":"121784","o":45450,"trddate":20170602},{"tdate":20170605,"c":45280,"t":0,"v":157414,"dtime":"1519","h":45490,"oi":0,"l":44900,"vs":"157414","o":44980,"trddate":20170605},{"tdate":20170606,"c":44920,"t":0,"v":158238,"dtime":"1517","h":45350,"oi":0,"l":44900,"vs":"158238","o":45160,"trddate":20170606},{"tdate":20170607,"c":44880,"t":0,"v":277966,"dtime":"1521","h":45300,"oi":0,"l":44680,"vs":"277966","o":44850,"trddate":20170607},{"tdate":20170608,"c":45260,"t":0,"v":209292,"dtime":"1522","h":45360,"oi":0,"l":44820,"vs":"209292","o":44980,"trddate":20170608},{"tdate":20170609,"c":45930,"t":0,"v":281390,"dtime":"1500","h":46000,"oi":0,"l":45490,"vs":"281390","o":45530,"trddate":20170609},{"tdate":20170612,"c":46370,"t":0,"v":246512,"dtime":"1519","h":46600,"oi":0,"l":46110,"vs":"246512","o":46220,"trddate":20170612},{"tdate":20170613,"c":45830,"t":0,"v":197490,"dtime":"1520","h":46340,"oi":0,"l":45810,"vs":"197490","o":46290,"trddate":20170613},{"tdate":20170614,"c":45960,"t":0,"v":224422,"dtime":"1500","h":46020,"oi":0,"l":45630,"vs":"224422","o":45650,"trddate":20170614},{"tdate":20170615,"c":45600,"t":0,"v":220290,"dtime":"1521","h":45920,"oi":0,"l":45380,"vs":"220290","o":45850,"trddate":20170615},{"tdate":20170616,"c":45490,"t":0,"v":201860,"dtime":"1500","h":45800,"oi":0,"l":45360,"vs":"201860","o":45550,"trddate":20170616},{"tdate":20170619,"c":45680,"t":0,"v":163648,"dtime":"1520","h":45770,"oi":0,"l":45430,"vs":"163648","o":45590,"trddate":20170619},{"tdate":20170620,"c":45840,"t":0,"v":174480,"dtime":"1520","h":46100,"oi":0,"l":45750,"vs":"174480","o":45830,"trddate":20170620},{"tdate":20170621,"c":45520,"t":0,"v":193626,"dtime":"1517","h":45660,"oi":0,"l":45360,"vs":"193626","o":45590,"trddate":20170621},{"tdate":20170622,"c":45810,"t":0,"v":232072,"dtime":"1524","h":46250,"oi":0,"l":45750,"vs":"232072","o":45880,"trddate":20170622},{"tdate":20170623,"c":46690,"t":0,"v":229244,"dtime":"1519","h":46720,"oi":0,"l":45900,"vs":"229244","o":46070,"trddate":20170623},{"tdate":20170626,"c":46820,"t":0,"v":192652,"dtime":"1517","h":46840,"oi":0,"l":46350,"vs":"192652","o":46640,"trddate":20170626},{"tdate":20170627,"c":46720,"t":0,"v":165084,"dtime":"1519","h":46750,"oi":0,"l":46430,"vs":"165084","o":46680,"trddate":20170627},{"tdate":20170628,"c":46920,"t":0,"v":190654,"dtime":"1519","h":47000,"oi":0,"l":46610,"vs":"190654","o":46690,"trddate":20170628},{"tdate":20170629,"c":47430,"t":0,"v":274182,"dtime":"1518","h":47520,"oi":0,"l":46770,"vs":"274182","o":46860,"trddate":20170629},{"tdate":20170630,"c":47460,"t":0,"v":197134,"dtime":"1519","h":47670,"oi":0,"l":47230,"vs":"197134","o":47430,"trddate":20170630},{"tdate":20170703,"c":47600,"t":0,"v":104806,"dtime":"1518","h":47650,"oi":0,"l":47370,"vs":"104806","o":47510,"trddate":20170703},{"tdate":20170704,"c":47030,"t":0,"v":148008,"dtime":"1518","h":47550,"oi":0,"l":46930,"vs":"148008","o":47490,"trddate":20170704},{"tdate":20170705,"c":47140,"t":0,"v":121620,"dtime":"1520","h":47360,"oi":0,"l":47080,"vs":"121620","o":47110,"trddate":20170705},{"tdate":20170706,"c":46960,"t":0,"v":146812,"dtime":"1518","h":46980,"oi":0,"l":46680,"vs":"146812","o":46870,"trddate":20170706},{"tdate":20170707,"c":47130,"t":0,"v":123504,"dtime":"1521","h":47150,"oi":0,"l":46800,"vs":"123504","o":46860,"trddate":20170707},{"tdate":20170710,"c":46770,"t":0,"v":165672,"dtime":"1500","h":47040,"oi":0,"l":46730,"vs":"165672","o":46910,"trddate":20170710},{"tdate":20170711,"c":47050,"t":0,"v":179100,"dtime":"1519","h":47170,"oi":0,"l":46580,"vs":"179100","o":46680,"trddate":20170711},{"tdate":20170712,"c":47250,"t":0,"v":223482,"dtime":"1519","h":47480,"oi":0,"l":46850,"vs":"223482","o":46920,"trddate":20170712},{"tdate":20170713,"c":47400,"t":0,"v":149728,"dtime":"1500","h":47520,"oi":0,"l":47120,"vs":"149728","o":47360,"trddate":20170713},{"tdate":20170714,"c":47160,"t":0,"v":165950,"dtime":"1520","h":47440,"oi":0,"l":46930,"vs":"165950","o":47440,"trddate":20170714},{"tdate":20170717,"c":47810,"t":0,"v":274074,"dtime":"1500","h":47930,"oi":0,"l":47120,"vs":"274074","o":47140,"trddate":20170717},{"tdate":20170718,"c":47690,"t":0,"v":204886,"dtime":"1524","h":48050,"oi":0,"l":47560,"vs":"204886","o":47950,"trddate":20170718},{"tdate":20170719,"c":47960,"t":0,"v":155696,"dtime":"1521","h":47980,"oi":0,"l":47660,"vs":"155696","o":47690,"trddate":20170719},{"tdate":20170720,"c":47790,"t":0,"v":199886,"dtime":"1523","h":47910,"oi":0,"l":47540,"vs":"199886","o":47860,"trddate":20170720},{"tdate":20170721,"c":48000,"t":0,"v":242490,"dtime":"1523","h":48110,"oi":0,"l":47410,"vs":"242490","o":47810,"trddate":20170721},{"tdate":20170724,"c":47760,"t":0,"v":174398,"dtime":"1519","h":48220,"oi":0,"l":47720,"vs":"174398","o":48200,"trddate":20170724},{"tdate":20170725,"c":48560,"t":0,"v":277318,"dtime":"1519","h":48690,"oi":0,"l":47790,"vs":"277318","o":47890,"trddate":20170725},{"tdate":20170726,"c":50050,"t":0,"v":513720,"dtime":"1500","h":50730,"oi":0,"l":48960,"vs":"513720","o":49000,"trddate":20170726},{"tdate":20170727,"c":50040,"t":0,"v":267478,"dtime":"1522","h":50420,"oi":0,"l":49910,"vs":"267478","o":49980,"trddate":20170727},{"tdate":20170728,"c":49940,"t":0,"v":257912,"dtime":"1518","h":50410,"oi":0,"l":49550,"vs":"257912","o":50210,"trddate":20170728},{"tdate":20170731,"c":50710,"t":0,"v":285858,"dtime":"1525","h":50860,"oi":0,"l":49920,"vs":"285858","o":50060,"trddate":20170731},{"tdate":20170801,"c":50340,"t":0,"v":123500,"dtime":"1522","h":50620,"oi":0,"l":50250,"vs":"123500","o":50430,"trddate":20170801},{"tdate":20170802,"c":50170,"t":0,"v":157788,"dtime":"1520","h":50520,"oi":0,"l":49960,"vs":"157788","o":50330,"trddate":20170802},{"tdate":20170803,"c":49980,"t":0,"v":186936,"dtime":"1521","h":50590,"oi":0,"l":49980,"vs":"186936","o":50200,"trddate":20170803},{"tdate":20170804,"c":50420,"t":0,"v":215792,"dtime":"1521","h":50650,"oi":0,"l":50110,"vs":"215792","o":50220,"trddate":20170804},{"tdate":20170807,"c":50440,"t":0,"v":313780,"dtime":"1500","h":51060,"oi":0,"l":50160,"vs":"313780","o":50400,"trddate":20170807},{"tdate":20170808,"c":50450,"t":0,"v":321062,"dtime":"1500","h":51160,"oi":0,"l":50350,"vs":"321062","o":50460,"trddate":20170808},{"tdate":20170809,"c":51310,"t":0,"v":412874,"dtime":"1524","h":51460,"oi":0,"l":50450,"vs":"412874","o":50450,"trddate":20170809},{"tdate":20170810,"c":50790,"t":0,"v":287458,"dtime":"1520","h":51370,"oi":0,"l":50640,"vs":"287458","o":51210,"trddate":20170810},{"tdate":20170811,"c":49970,"t":0,"v":376090,"dtime":"1500","h":50730,"oi":0,"l":49760,"vs":"376090","o":50690,"trddate":20170811},{"tdate":20170814,"c":50060,"t":0,"v":225496,"dtime":"1524","h":50480,"oi":0,"l":49980,"vs":"225496","o":50210,"trddate":20170814},{"tdate":20170815,"c":50330,"t":0,"v":168522,"dtime":"1520","h":50400,"oi":0,"l":50060,"vs":"168522","o":50200,"trddate":20170815},{"tdate":20170816,"c":50170,"t":0,"v":221076,"dtime":"1500","h":50400,"oi":0,"l":49880,"vs":"221076","o":50330,"trddate":20170816},{"tdate":20170817,"c":51470,"t":0,"v":425214,"dtime":"1500","h":51680,"oi":0,"l":50530,"vs":"425214","o":50540,"trddate":20170817},{"tdate":20170818,"c":51060,"t":0,"v":259318,"dtime":"1519","h":51230,"oi":0,"l":50620,"vs":"259318","o":51090,"trddate":20170818},{"tdate":20170821,"c":51650,"t":0,"v":403734,"dtime":"1500","h":51920,"oi":0,"l":50650,"vs":"403734","o":51100,"trddate":20170821},{"tdate":20170822,"c":52190,"t":0,"v":385120,"dtime":"1521","h":52210,"oi":0,"l":51370,"vs":"385120","o":51640,"trddate":20170822},{"tdate":20170823,"c":51560,"t":0,"v":330686,"dtime":"1520","h":52330,"oi":0,"l":51300,"vs":"330686","o":52270,"trddate":20170823},{"tdate":20170824,"c":51890,"t":0,"v":291158,"dtime":"1522","h":52150,"oi":0,"l":51360,"vs":"291158","o":51510,"trddate":20170824},{"tdate":20170825,"c":52770,"t":0,"v":376636,"dtime":"1500","h":52840,"oi":0,"l":51780,"vs":"376636","o":51860,"trddate":20170825},{"tdate":20170828,"c":52920,"t":0,"v":343244,"dtime":"1521","h":52970,"oi":0,"l":52030,"vs":"343244","o":52770,"trddate":20170828},{"tdate":20170829,"c":52670,"t":0,"v":246030,"dtime":"1519","h":53050,"oi":0,"l":52430,"vs":"246030","o":52960,"trddate":20170829},{"tdate":20170830,"c":52700,"t":0,"v":235602,"dtime":"1520","h":52980,"oi":0,"l":52510,"vs":"235602","o":52880,"trddate":20170830},{"tdate":20170831,"c":52820,"t":0,"v":212712,"dtime":"1519","h":52880,"oi":0,"l":52360,"vs":"212712","o":52530,"trddate":20170831},{"tdate":20170901,"c":52800,"t":0,"v":176536,"dtime":"1500","h":52960,"oi":0,"l":52560,"vs":"176536","o":52960,"trddate":20170901},{"tdate":20170904,"c":53150,"t":0,"v":215214,"dtime":"1522","h":53400,"oi":0,"l":52500,"vs":"215214","o":52530,"trddate":20170904},{"tdate":20170905,"c":53610,"t":0,"v":159896,"dtime":"1518","h":53700,"oi":0,"l":53020,"vs":"159896","o":53080,"trddate":20170905},{"tdate":20170906,"c":53290,"t":0,"v":172018,"dtime":"1500","h":53600,"oi":0,"l":52730,"vs":"172018","o":53490,"trddate":20170906},{"tdate":20170907,"c":52790,"t":0,"v":200062,"dtime":"1500","h":53400,"oi":0,"l":52720,"vs":"200062","o":53130,"trddate":20170907},{"tdate":20170912,"c":51700,"t":0,"v":219924,"dtime":"1520","h":51950,"oi":0,"l":51420,"vs":"219924","o":51760,"trddate":20170912},{"tdate":20170913,"c":51000,"t":0,"v":231800,"dtime":"1518","h":51510,"oi":0,"l":50980,"vs":"231800","o":51120,"trddate":20170913},{"tdate":20170914,"c":50380,"t":0,"v":285450,"dtime":"1500","h":50850,"oi":0,"l":50370,"vs":"285450","o":50640,"trddate":20170914},{"tdate":20170915,"c":50380,"t":0,"v":229932,"dtime":"1520","h":50620,"oi":0,"l":50170,"vs":"229932","o":50380,"trddate":20170915},{"tdate":20170918,"c":50700,"t":0,"v":284904,"dtime":"1522","h":50790,"oi":0,"l":49860,"vs":"284904","o":50240,"trddate":20170918},{"tdate":20170919,"c":50730,"t":0,"v":177744,"dtime":"1522","h":50910,"oi":0,"l":50460,"vs":"177744","o":50650,"trddate":20170919},{"tdate":20170920,"c":50810,"t":0,"v":180602,"dtime":"1519","h":50990,"oi":0,"l":50550,"vs":"180602","o":50710,"trddate":20170920},{"tdate":20170921,"c":50160,"t":0,"v":257624,"dtime":"1500","h":50850,"oi":0,"l":49940,"vs":"257624","o":50770,"trddate":20170921},{"tdate":20170922,"c":49630,"t":0,"v":351468,"dtime":"1500","h":50470,"oi":0,"l":49340,"vs":"351468","o":50260,"trddate":20170922},{"tdate":20170925,"c":50260,"t":0,"v":247008,"dtime":"1521","h":50510,"oi":0,"l":49820,"vs":"247008","o":49840,"trddate":20170925},{"tdate":20170926,"c":50640,"t":0,"v":173940,"dtime":"2059","h":50820,"oi":0,"l":50170,"vs":"173940","o":50210,"trddate":20170926},{"tdate":20170927,"c":50540,"t":0,"v":201670,"dtime":"2059","h":50680,"oi":0,"l":50080,"vs":"201670","o":50460,"trddate":20170927},{"tdate":20170928,"c":50620,"t":0,"v":247942,"dtime":"2059","h":50700,"oi":0,"l":50060,"vs":"247942","o":50590,"trddate":20170928},{"tdate":20170929,"c":51880,"t":0,"v":161078,"dtime":"2059","h":51880,"oi":0,"l":50660,"vs":"161078","o":50780,"trddate":20170929},{"tdate":20171009,"c":52130,"t":0,"v":87856,"dtime":"916","h":52470,"oi":0,"l":51950,"vs":"87856","o":52120,"trddate":20171009},{"tdate":20171010,"c":51870,"t":0,"v":146488,"dtime":"2059","h":52320,"oi":0,"l":51830,"vs":"146488","o":52030,"trddate":20171010},{"tdate":20171011,"c":52440,"t":0,"v":205294,"dtime":"2059","h":52500,"oi":0,"l":51710,"vs":"205294","o":51890,"trddate":20171011}]';
var json = JSON.parse(jsonstr);

最终效果图:

MACD知识入门_第1张图片

你可能感兴趣的:(投资理财)