请牛大帮忙修改ATR指标,使其能显示3条线,5日ATR,10ATR,20ATR //+------------------------------------------------------------------+ //| ATR.mq4 | //| Copyright ?2005, metaQuotes Software Corp. | //| http://www.metaquotes.net/ | //+------------------------------------------------------------------+ #property copyright "Copyright ?2005, metaQuotes Software Corp." #property link "http://www.metaquotes.net/" #property indicator_separate_window #property indicator_buffers 1 #property indicator_color1 DodgerBlue //---- input parameters extern int AtrPeriod=14; //---- buffers double AtrBuffer[]; double TempBuffer[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- 1 additional buffer used for counting. IndicatorBuffers(2); //---- indicator line SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,AtrBuffer); SetIndexBuffer(1,TempBuffer); //---- name for DataWindow and indicator subwindow label short_name="ATR("+AtrPeriod+")"; IndicatorShortName(short_name); SetIndexLabel(0,short_name); //---- SetIndexDrawBegin(0,AtrPeriod); //---- return(0); } //+------------------------------------------------------------------+ //| Average True Range | //+------------------------------------------------------------------+ int start() { int i,counted_bars=IndicatorCounted(); //---- if(Bars |
请牛大帮忙修改ATR指标,使其能显示3条线
回复:0 浏览:253
- 楼主admin 圈主
- 2019-05-05 15:22