Nun hätte ich eine Frage zum folgenden Indikator:
Ich habe das Problem, dass die grüne Linie nicht angezeigt wird, wenn ich den Indikator anlege.
Ich muss ihm immer erst kompilieren, damit die Linie sichtbar wird.
HTML-Code:
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Yellow
#property indicator_width1 2
#property indicator_color2 Green
#property indicator_width2 2
extern int BBPeriod = 34;
extern int StdDeviation = 2;
extern int MAPeriod = 23;
double BLGBuffer[];
double MABuffer[];
int init() {
string short_name;
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,BLGBuffer);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,MABuffer);
return(0);
}
int start() {
int i = Bars - IndicatorCounted() - 1;
while(i>=0){
double dUpperBand = iBands(NULL,0,BBPeriod,StdDeviation,0,PRICE_CLOSE,MODE_UPPER,i);
double dLowerBand = iBands(NULL,0,BBPeriod,StdDeviation,0,PRICE_CLOSE,MODE_LOWER,i);
BLGBuffer[i] = dUpperBand - dLowerBand;
MABuffer[i] = iMAOnArray(BLGBuffer,0,MAPeriod,0,MODE_SMA,i);
i--;
}
return(0);
}