FAQ > 金融建模 > 建模问题 > 其他

Q:在画图中,如何实现标记?    

  • A:用多图组合的方式实现,不标记的地方数值为nil。如下:标记当天分钟线上,接近当天最高价与当天最低价的点。

    setsysparam(pn_stock(),'SZ000002');
      setsysparam(pn_cycle(),cy_day());
      setsysparam(pn_date(),20190820T);
      H:=high()*0.998;
      L:=low()*1.002;
      setsysparam(pn_cycle(),cy_1m());
      htsj:=select datetimetostr(['date']) as 'time',['close'] from markettable datekey 20190820T to 20190820.16T of 'SZ000002' end;
      lowpoint:=htsj;
      update lowpoint set ['close']=nil where ['close']>L end;
      highpoint:=htsj;
      update highpoint set ['close']=nil where ['close']<H end;

      g1:=graph(gtcircle(),"low",lowpoint ,gfColor(), clGreen()); //低点画图
      g2:=graph(gtcircle(),"high",highpoint ,gfColor(),clred()); //高点画图
      g3:=graph(gtline(),"close",htsj,gfColor(),clBlack()); //走势图
      g:=GraphGroup(g3,g1,g2); //组合画图
      return g;
    //结果展示