Einzelnen Beitrag anzeigen
  #10 (permalink)  
Alt 08.08.18
FatSpiderman FatSpiderman ist offline
Neues Mitglied
 
Registriert seit: Dec 2016
Beiträge: 16
FatSpiderman befindet sich auf einem aufstrebenden Ast
Standard

Code:
//---- buffers

double ATR_upper_1[];              //Buffer der oberen Kanalgrenze
double ATR_lower_1[];              //Buffer der unteren Kanalgrenze

//---- Input Variables

...

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexStyle(0, DRAW_LINE, ATR_1_style, ATR_1_width, ATR_1_COLOR);    // ATR_upper_1[]
   SetIndexBuffer(0, ATR_upper_1);                                     // ATR_upper_1[]
  
   SetIndexStyle(1, DRAW_LINE, ATR_1_style, ATR_1_width, ATR_1_COLOR);    // ATR_lower_1[]
   SetIndexBuffer(1, ATR_lower_1);                                     // ATR_upper_1[]
//---
   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {   
....
Schau dir mal die Bedeutung der Buffer und die Funktionen SetIndexStyle und SetIndexBuffer an. Das Verbinden der Indikatorwerte wird nach der Übergabe der entsprechenden Werte an den Indikator Buffer automatisch übernommen.