Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools
Zurück   Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools > Metatrader 5 > Indikatoren

Indikatoren Indikatoren für Metatrader 5.

Login
Benutzername:
Kennwort:


Statistik
Themen: 4973
Beiträge: 43249
Benutzer: 7.219
Aktive Benutzer: 81
Links: 84
Wir begrüßen unseren neuesten Benutzer: Hopfen&Malz
Mit 2.475 Benutzern waren die meisten Benutzer gleichzeitig online (16.01.20 um 22:38).
Neue Benutzer:
vor einem Tag
- Hopfen&Mal...
vor 2 Tagen
- frankmicha...
vor einer Woche
- DFeck
vor einer Woche
- bb1107
vor 2 Wochen
- rg-trader

Onlineuser
'Wer ist online' anzeigen Benutzer: 0
Gäste: 262
Gesamt: 262
Team: 0
Team:  
Benutzer:  
Freunde anzeigen

Empfehlungen

Thema geschlossen
 
Themen-Optionen Thema durchsuchen Ansicht
  #1 (permalink)  
Alt 27.05.21
Mitglied
 
Registriert seit: Sep 2018
Beiträge: 238
Max2018 befindet sich auf einem aufstrebenden Ast
Standard Relative Stärke nach Levy im MT5

Hi,

hat jemand für Euch einen MT5 Indikator mit der Relativen Stärke nach Levy?
  #2 (permalink)  
Alt 27.05.21
Benutzerbild von Indikator-Trading
Premium Mitglied
 
Registriert seit: May 2020
Ort: Bielefeld
Beiträge: 345
Indikator-Trading befindet sich auf einem aufstrebenden Ast
Standard

Ich habe keine MT5 Version direkt gefunden. Hier aber die MT4 Version.

https://www.mql5.com/de/code/21077

Der Indikator ist denkbar einfach, lässt sich also auch als MT5 Version umsetzen.

Das hier ist alles was der Indikator macht:
Code:
Buffer[i] = Close[i]/iMA(_Symbol,0,InpMAPeriod,0,InpMAMethod,InpMAPrice,i);
  #3 (permalink)  
Alt 28.05.21
Mitglied
 
Registriert seit: Sep 2018
Beiträge: 238
Max2018 befindet sich auf einem aufstrebenden Ast
Standard

Irgendwie geht das nicht:

Code:
//--- indicator settings
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots   1
#property indicator_levelcolor clrSilver
#property indicator_levelstyle STYLE_DOT
#property indicator_type1   DRAW_LINE
#property indicator_label1    "RSL"
#property indicator_level1    1.0
#property indicator_color1  DodgerBlue
//--- indicator buffer
input int InpMAPeriod               = 14;          // MA Period
input ENUM_MA_METHOD InpMAMethod    = MODE_SMA;    // MA Method
input ENUM_APPLIED_PRICE InpMAPrice = PRICE_CLOSE; // MA Applied Price
double ExtWADBuffer[];
double Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void OnInit()
  {
   SetIndexBuffer(0,Buffer);
   string sShortName="RSL("+IntegerToString(InpMAPeriod)+")";

  // string sShortName="RSL("+IntegerToString(InpMAPeriod)+")";
  // IndicatorShortName(sShortName);
  // return(INIT_SUCCEEDED);
  
//--- define buffer
   SetIndexBuffer(0,ExtWADBuffer);
//--- set draw begin
   PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,1);
//--- indicator name
   IndicatorSetString(INDICATOR_SHORTNAME,"LEVY");
//--- round settings
   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);
  }
//+------------------------------------------------------------------+
//| 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[])
  {
//---
   if(rates_total<2)
      return(0);
//--- start working
   int pos=prev_calculated-1;
   int bars = rates_total-1;
   if(pos<1)
     {
      pos=1;
      ExtWADBuffer[0]=0.0;
     }
//--- main cycle

   if(!VerifyHistory()) return(prev_calculated);
   if(prev_calculated>0) bars = rates_total - prev_calculated;
   for(int i=0; i<bars; i++)
     {
      //--- get data 
      //--- calculate WA/D
      ExtWADBuffer[i]= close[i]/iMA(NULL,0,InpMAPeriod,i,InpMAMethod,InpMAPrice);
     }
      
//--- OnCalculate done. Return new prev_calculated.
   return(rates_total);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+

bool VerifyHistory(string symbol = NULL) {
   if(symbol==NULL) symbol=_Symbol;
   bool x = true;
   datetime ArrayTime[];
   ArraySetAsSeries(ArrayTime,true);
   int copied = CopyTime(symbol,PERIOD_M1,0,2,ArrayTime);
   if(copied<0) x = false;
   return x;
}
  #4 (permalink)  
Alt 29.05.21
Mitglied
 
Registriert seit: Sep 2018
Beiträge: 238
Max2018 befindet sich auf einem aufstrebenden Ast
Standard

Hi, hat keiner ne Idee warum der Indikator nicht läuft
  #5 (permalink)  
Alt 31.05.21
Mitglied
 
Registriert seit: Sep 2018
Beiträge: 238
Max2018 befindet sich auf einem aufstrebenden Ast
Standard

Das Forum ist wohl schon in Sommerpause
  #6 (permalink)  
Alt 31.05.21
Benutzerbild von Indikator-Trading
Premium Mitglied
 
Registriert seit: May 2020
Ort: Bielefeld
Beiträge: 345
Indikator-Trading befindet sich auf einem aufstrebenden Ast
Standard

Versuch es mal hiermit:

Code:
//+------------------------------------------------------------------+
//|                                                         MACD.mq5 |
//|                   Copyright 2009-2020, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright   "2009-2020, MetaQuotes Software Corp."
#property link        "http://www.mql5.com"
#property description "LEVY with EMA and Smooth function"
#include <MovingAverages.mqh>
//--- indicator settings
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_plots   2
#property indicator_type1   DRAW_HISTOGRAM
#property indicator_type2   DRAW_LINE
#property indicator_color1  Silver
#property indicator_color2  Red
#property indicator_width1  2
#property indicator_width2  1
#property indicator_label1  "LEVY"
#property indicator_label2  "Smoothed LEVY"
//--- input parameters
//input int                InpFastEMA=1;               // Fast EMA period
input int                InpSlowEMA=26;               // Slow EMA period
input int                InpSignalSMA=9;              // Signal SMA period
input ENUM_APPLIED_PRICE InpAppliedPrice=PRICE_CLOSE; // Applied price
//--- indicator buffers
double ExtMacdBuffer[];
double ExtSignalBuffer[];
double ExtFastMaBuffer[];
double ExtSlowMaBuffer[];

int    ExtFastMaHandle;
int    ExtSlowMaHandle;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,ExtMacdBuffer,INDICATOR_DATA);
   SetIndexBuffer(1,ExtSignalBuffer,INDICATOR_DATA);
   SetIndexBuffer(2,ExtFastMaBuffer,INDICATOR_CALCULATIONS);
   SetIndexBuffer(3,ExtSlowMaBuffer,INDICATOR_CALCULATIONS);
//--- sets first bar from what index will be drawn
   PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,InpSignalSMA-1);
//--- name for indicator subwindow label
   string short_name=StringFormat("LEVY(%d,%d)",InpSlowEMA,InpSignalSMA);
   IndicatorSetString(INDICATOR_SHORTNAME,short_name);
//--- get MA handles
   //ExtFastMaHandle=iMA(NULL,0,InpFastEMA,0,MODE_SMA,PRICE_CLOSE);
   ExtSlowMaHandle=iMA(NULL,0,InpSlowEMA,0,MODE_EMA,PRICE_CLOSE);
  }
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence                           |
//+------------------------------------------------------------------+
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[])
  {
   if(rates_total<InpSignalSMA)
      return(0);
//--- not all data may be calculated
 /* int calculated=BarsCalculated(ExtFastMaHandle);
   if(calculated<rates_total)
     {
      Print("Not all data of ExtFastMaHandle is calculated (",calculated," bars). Error ",GetLastError());
      return(0);
     }*/
   int calculated=BarsCalculated(ExtSlowMaHandle);
   if(calculated<rates_total)
     {
      Print("Not all data of ExtSlowMaHandle is calculated (",calculated," bars). Error ",GetLastError());
      return(0);
     }
//--- we can copy not all data
   int to_copy;
   if(prev_calculated>rates_total || prev_calculated<0)
      to_copy=rates_total;
   else
     {
      to_copy=rates_total-prev_calculated;
      if(prev_calculated>0)
         to_copy++;
     }
//--- get Fast EMA buffer
   /*if(IsStopped()) // checking for stop flag
      return(0);
   if(CopyBuffer(ExtFastMaHandle,0,0,to_copy,ExtFastMaBuffer)<=0)
     {
      Print("Getting fast EMA is failed! Error ",GetLastError());
      return(0);
     }*/
//--- get SlowSMA buffer
   if(IsStopped()) // checking for stop flag
      return(0);
   if(CopyBuffer(ExtSlowMaHandle,0,0,to_copy,ExtSlowMaBuffer)<=0)
     {
      Print("Getting slow SMA is failed! Error ",GetLastError());
      return(0);
     }
//---
   int start;
   if(prev_calculated==0)
      start=0;
   else
      start=prev_calculated-1;
//--- calculate MACD
   for(int i=start; i<rates_total && !IsStopped(); i++)
      ExtMacdBuffer[i]=close[i]-ExtSlowMaBuffer[i];
//--- calculate Signal
   SimpleMAOnBuffer(rates_total,prev_calculated,0,InpSignalSMA,ExtMacdBuffer,ExtSignalBuffer);
//--- OnCalculate done. Return new prev_calculated.
   return(rates_total);
  }
//+------------------------------------------------------------------+
  #7 (permalink)  
Alt 31.05.21
Mitglied
 
Registriert seit: Sep 2018
Beiträge: 238
Max2018 befindet sich auf einem aufstrebenden Ast
Standard

Danke. Hat geklappt
Thema geschlossen

Lesezeichen

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are aus
Pingbacks are aus
Refbacks are aus




Alle Zeitangaben in WEZ +1. Es ist jetzt 15:57 Uhr.





Suchmaschine - Reisen - Wavesnode - Facebook Forum - Spam Firewall
-----------------------------------------------------------------------------------------------------------------------------
Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Powered by vBCMS® 2.7.0 ©2002 - 2024 vbdesigns.de
SEO by vBSEO 3.6.1
Copyright ©2009 - 2023 by Expert-Advisor.com - Das Metatrader Forum
MetaTrader bzw. MetaTrader 4 und MetaTrader 5 sind eingetragene Marken der MetaQuotes Software Corp.
-----------------------------------------------------------------------------------------------------------------------------