Fragen von Anfängern MQL5 MT5 MetaTrader 5 - Seite 751

 
Vitaly Muzichenko:
Die Dokumentation deckt dies sehr gut ab, und es gibt sogar ein fertiges und funktionierendes Beispiel

In der Dokumentation zu DRAW_HISTOGRAM2 fehlt diese Angabe.
 
igorbel:

In der DRAW_HISTOGRAM2-Dokumentation gibt es keinen solchen Hinweis.

Ja, ein bisschen anders

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
 

Was soll ich überhaupt im Farbpuffer speichern? Das Beispiel dort ist etwas kompliziert.
 

Ich habe es herausgefunden.

Awesome_Oscillator aus den Beispielen ist einfacher.

 

Ich habe dies getan, aber jetzt werden die anderen Indikatorpuffer nicht angezeigt :(

Es sind nur Linien.

//--- 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 sind Histogramme.

buf2, buf3 sind Zeilen und werden nicht angezeigt, obwohl die Werte vorhanden sind.

 
igorbel:

Ich habe dies getan, aber jetzt werden die anderen Indikatorpuffer nicht angezeigt :(

Es sind nur Linien.

buf0, buf1, buf_colors sind Histogramme.

buf2, buf3 sind Zeilen, sie werden nicht angezeigt, obwohl die Werte vorhanden sind.

Sind die Werte korrekt?

#property indicator_buffers 
#property indicator_plots   
 
Vitaly Muzichenko:

Sind Ihre Werte korrekt?


#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
Dies sind alles Richtlinien.
 
igorbel:

Dies sind alles Richtlinien.
Haben Sie bei den anderen Puffern eine Farbe eingestellt?
 
Vitaly Muzichenko:
Haben Sie bei den anderen Puffern eine Farbe eingestellt?


Ja, es gibt eine im vorherigen Beitrag.

   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
Das hat geholfen. Das ist seltsam.
Grund der Beschwerde: