Objectlaagvolgorde van indicatoren
1 Bijlage (n) Ik heb deze klassieke MACD met histogram waarbij het histogram wordt getekend v��r de MACD- en signaallijnen. Kan iemand me alsjeblieft laten zien hoe je het Histogram achterin moet plaatsen? Ik heb geprobeerd het te achterhalen, maar zonder succes.
Bedankt,
Laurus
Bewerken: ik heb hulp. Moest de volgorde van de buffers veranderen
https://www.aforexa.com/attachments/1529228216.png. Heb het indior-bestand met het histogram aan de achterkant bevestigd als iemand het zou willen hebben.
// ----------------------------------------------- ----------------------------
//| _MACD.mq4 |
//| |
//| De klassieke MACD met histogram |
// ----------------------------------------------- ----------------------------
/---- indior settings
#property indior_separate_window
#property indior_buffers 3
#property indior_color1 Black
#property indior_color2 Rood
#eigenschap indior_color3 SteelBlue
#property indior_width1 1
#property indior_width2 1
#property indior_width3 2
//---- binnenparameters
extern int FastEMA = 12;
extern int SlowEMA = 26;
extern int SignalEMA = 9;
//---- indoor buffers
dubbele MACD_Buffer [];
dubbele SIGNAL_Buffer [];
dubbele HISTOGRAM_Buffer [];
// ----------------------------------------------- -------------------
//| Aangepaste initialisatiefunctie voor binnenshuis |
// ----------------------------------------------- -------------------
int init () {
//---- tekeninstellingen
SetIndexStyle (0, DRAW_LINE);
SetIndexStyle (1, DRAW_LINE);
SetIndexStyle (2, DRAW_HISTOGRAM);
SetIndexDrawBegin (1, SignalEMA);
IndiorDigits (Cijfers 1);
//---- kaarten voor binnenbuffers
SetIndexBuffer (0, MACD_Buffer);
SetIndexBuffer (1, SIGNAL_Buffer);
SetIndexBuffer (2, HISTOGRAM_Buffer);
//---- naam voor DataWindow en label voor binnenste subvenster
IndiorShortName (_MACD ( FastEMA , SlowEMA , SignalEMA ));
SetIndexLabel (0, MACD);
SetIndexLabel (1, Signal);
SetIndexLabel (2, histogram);
//---- initialisatie voltooid
return (0);
}
// ----------------------------------------------- -------------------
//| Moving Averages ConvergenceDivergence |
// ----------------------------------------------- -------------------
int start () {
int i;
int limiet;
int counted_bars = IndiorCounted ();
if (counted_bars lt; 0) return (-1);/---- controleren op mogelijke fouten
if (counted_bars gt; 0) counted_bars--;/---- de laatst getelde balk wordt opnieuw verteld
limit = Bars - counted_bars;
//---- Teken de MACD-lijn
voor (i = 0; ilt; limit; i ) {//- loop van de huidige balk naar de eerste balk
MACD_Buffer [i] = iMA (NULL, 0, FastEMA, 0, MODE_EMA, PRICE_CLOSE, i) - iMA (NULL, 0, SlowEMA, 0, MODE_EMA, PRICE_CLOSE, i);
}
//---- Teken signaalregel en histogram
voor (i = 0; ilt; limit; i ) {//- zelfde lus hierboven
SIGNAL_Buffer [i] = iMAOnArray (MACD_Buffer, Bars, SignalEMA, 0, MODE_EMA, i);
HISTOGRAM_Buffer [i] = MACD_Buffer [i] - SIGNAL_Buffer [i];
}
//---- Gedaan
return (0);
}
// ----------------------------------------------- ------------------
https://www.aforexa.com/attachments/...9674855516.mq4