初心者の方からの質問 MQL5 MT5 MetaTrader 5 - ページ 751

 
Vitaly Muzichenko:
ドキュメントでは、この点を非常によくカバーしており、すぐに使える例もあります。

DRAW_HISTOGRAM2 のドキュメントには、このような記述はありません。
 
igorbel:

DRAW_HISTOGRAM2 のドキュメントには、そのような記述はありません。

はい、少し違います

https://www.mql5.com/en/docs/customind/indicators_examples/draw_color_histogram2

Documentation on MQL5: Custom Indicators / Indicator Styles in Examples / DRAW_COLOR_HISTOGRAM2
Documentation on MQL5: Custom Indicators / Indicator Styles in Examples / DRAW_COLOR_HISTOGRAM2
  • www.mql5.com
Custom Indicators / Indicator Styles in Examples / DRAW_COLOR_HISTOGRAM2 - Reference on algorithmic/automated trading language for MetaTrader 5
 

カラーバッファに 何を保存すればいいのですか?そこの例は、ちょっと複雑です。
 

図星だったんですね。

例題のAwesome_Oscillatorの方が簡単です。

 

このようにしましたが、他のインジケーターバッファが 表示されなくなりました :(

線があるだけです。

//--- indicator buffers mapping
   SetIndexBuffer(0,buf0,INDICATOR_DATA);
   PlotIndexSetString(0,PLOT_LABEL,"buf0");
   //---
   SetIndexBuffer(1,buf1,INDICATOR_DATA);
   PlotIndexSetString(1,PLOT_LABEL,"buf1");
   //---
   SetIndexBuffer(2,buf_colors,INDICATOR_COLOR_INDEX);
   //---
   SetIndexBuffer(3,buf2,INDICATOR_DATA);
   PlotIndexSetInteger(3,PLOT_DRAW_TYPE,DRAW_LINE);
   PlotIndexSetInteger(3,PLOT_LINE_STYLE,STYLE_SOLID);
   PlotIndexSetInteger(3,PLOT_LINE_COLOR,clrRoyalBlue);
   PlotIndexSetString(3,PLOT_LABEL,"buf2");
   //---
   SetIndexBuffer(4,buf3,INDICATOR_DATA);
   PlotIndexSetInteger(4,PLOT_DRAW_TYPE,DRAW_LINE);
   PlotIndexSetInteger(4,PLOT_LINE_STYLE,STYLE_SOLID);
   PlotIndexSetInteger(4,PLOT_LINE_COLOR,clrRed);
   PlotIndexSetString(4,PLOT_LABEL,"buf3");

buf0, buf1, buf_colors はヒストグラムである。

buf2, buf3 は行であり、値は存在するが表示されない。

 
igorbel:

このようにしましたが、他のインジケーターバッファが 表示されなくなりました :(

線があるだけです。

buf0, buf1, buf_colors はヒストグラムである。

buf2, buf3 は行であり、値は存在するが表示されない。

数値は正しいか?

#property indicator_buffers 
#property indicator_plots   
 
Vitaly Muzichenko:

あなたの価値観は正しいですか?


#property indicator_chart_window
#property indicator_buffers 5
#property indicator_plots 3
#property  indicator_type1   DRAW_COLOR_HISTOGRAM2
#property  indicator_color1 clrRed,clrRoyalBlue
#property  indicator_style1  STYLE_SOLID 
#property  indicator_width1  3
これらはすべてディレクティブです。
 
igorbel:

これらはすべてディレクティブです。
他のバッファーに色を設定しましたか?
 
Vitaly Muzichenko:
他のバッファーに色を設定しましたか?


はい、前の記事にもありますね。

   SetIndexBuffer(3,buf2,INDICATOR_DATA);
   PlotIndexSetInteger(3,PLOT_DRAW_TYPE,DRAW_LINE);
   PlotIndexSetInteger(3,PLOT_LINE_STYLE,STYLE_SOLID);
   PlotIndexSetInteger(3,PLOT_LINE_COLOR,clrRoyalBlue);
   PlotIndexSetString(3,PLOT_LABEL,"buf2");
   //---
   SetIndexBuffer(4,buf3,INDICATOR_DATA);
   PlotIndexSetInteger(4,PLOT_DRAW_TYPE,DRAW_LINE);
   PlotIndexSetInteger(4,PLOT_LINE_STYLE,STYLE_SOLID);
   PlotIndexSetInteger(4,PLOT_LINE_COLOR,clrRed);
   PlotIndexSetString(4,PLOT_LABEL,"buf3");
 
#property  indicator_type2   DRAW_LINE
#property  indicator_type3   DRAW_LINE
それは助かりました。それは変ですね。
理由: