Einzelnen Beitrag anzeigen
  #1 (permalink)  
Alt 29.03.20
Sirocool Sirocool ist offline
Mitglied
 
Registriert seit: Feb 2014
Ort: Berlin
Beiträge: 42
Sirocool befindet sich auf einem aufstrebenden Ast
Standard Hilfe beim Indikator bauen

Hey Leute ich bräuchte mal Hilfe bei was bin neu Hier und probiere gerade mal was aus.

der Indikator berechnet drei Indikatoren (RSI;STOCH;CCI) und soll mir das unten dann anzeigen wie beim RSI in einer Linie die auch zickzack macht und nicht gerade durchgeht. Wäre euch dankbar dabei mir mal zuhelfen

[IMG]blob:https://mega.nz/12aa580d-0748-43e5-9e10-34e66155dc77[/IMG]

und hier der Mql4 Code

Code:
//+------------------------------------------------------------------+
//|                                                            2.mq4 |
//|                                          M.Streit Copyright 2020 |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "M.Streit Copyright 2020"
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#property indicator_separate_window
//#property indicator_chart_window
#property indicator_buffers 1
#property indicator_width1  1
#property indicator_width2  1
#property indicator_minimum -200
#property indicator_maximum 200



double tops[];
double bottoms[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
IndicatorShortName("Beta2020");  
  
SetIndexBuffer(0,tops);
SetIndexStyle(0,DRAW_LINE,EMPTY,1,clrBlue);
SetIndexLabel(0,"tops");

SetIndexBuffer(1,bottoms);
SetIndexStyle(1,DRAW_LINE);
SetIndexLabel(0,"bottoms");
   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[])
  {
/* Berechnung des Indikatorwertes den er ausgeben soll */  
double RSIWert = DoubleToStr(iRSI(Symbol(),0,14,PRICE_CLOSE,1),2);
double CCIWERT = DoubleToStr(iCCI(Symbol(),0,14,PRICE_CLOSE,0),2);
double SToWERT = DoubleToStr(iStochastic(Symbol(),0,14,3,3,MODE_SMA,0,MODE_MAIN,0),2);
/* Ausgabewert den er ausgeben soll */ 
double DWert = DoubleToStr((SToWERT+RSIWert+CCIWERT)/3,2);
  
 for(int i=Bars-1;i>=0;i--)
 {
 tops[i]=DWert;
 //bottoms[i]=Low[i];
 }
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
//---
   
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---
   
  }
//+------------------------------------------------------------------+
Mit freundlichen Grüßen

Sirocool