Ich werde den Indikator kostenlos schreiben - Seite 103

 

Hilfe bei der Suche nach einem Fehler

Dem Indikator wurden zwei Puffer hinzugefügt, die jedoch nicht im Diagramm angezeigt werden

//+------------------------------------------------------------------+
//|                                                   MTF_Moving.mq4 |
//|                        Copyright 2017, MetaQuotes Software Corp. |
//|                             https://www.mql5.com/ru/users/melnik |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, MetaQuotes Software Corp."
#property link      "https://www.mql5.com/ru/users/melnik"
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2
#property indicator_width4 2
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 Black
#property indicator_color4 Black
#property indicator_type1 DRAW_LINE
#property indicator_type2 DRAW_LINE
#property indicator_type3 DRAW_LINE
#property indicator_type4 DRAW_LINE

double ma_buffer_slow[];
double ma_buffer_fast[];
double ma_buffer_s_01[];
double ma_buffer_s_02[];

//--- input parameters
input int                     PeriodMaSlow   =21;  //Period slow Ma
input int                     PeriodMaFast   =13;  //Pertiod fast Ma
input int                     Points         =50;  //Отклонение
input ENUM_APPLIED_PRICE      PriceMa        = 0;  //Applied price
input ENUM_MA_METHOD          MethodMa       = 0;  //Method Ma
input ENUM_TIMEFRAMES         Timeframe      =60;  //Timeframe for calculate

ENUM_TIMEFRAMES prd;

int index=-1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0, ma_buffer_slow, INDICATOR_DATA);
   SetIndexBuffer(1, ma_buffer_fast, INDICATOR_DATA);
   SetIndexBuffer(2, ma_buffer_s_01, INDICATOR_DATA);
   SetIndexBuffer(3, ma_buffer_s_02, INDICATOR_DATA);
//---
   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[])
  {
//---
   if((rates_total-prev_calculated-PeriodMaSlow)<=0)return(0);
  
   if(Period()>Timeframe) prd=PERIOD_CURRENT;
   if(Period()<=Timeframe) prd=prd=Timeframe;
  
   for(int i=rates_total-prev_calculated-PeriodMaSlow-1;i>=0;i--)
   {
      if(TimeMinute(time[i])==0)index=iBarShift(Symbol(), prd, time[i], false);
      
      ma_buffer_fast[i]=iMA(Symbol(), prd, PeriodMaFast, 0, MethodMa, PriceMa, index);
      ma_buffer_slow[i]=iMA(Symbol(), prd, PeriodMaSlow, 0, MethodMa, PriceMa, index);
      
      if(ma_buffer_fast[i+1]>=ma_buffer_slow[i+1] && ma_buffer_fast[i]<ma_buffer_slow[i])
      {ma_buffer_s_01[i]=ma_buffer_slow[i]+Points*Point;}
      
      if(ma_buffer_fast[i+1]<=ma_buffer_slow[i+1] && ma_buffer_fast[i]>ma_buffer_slow[i])
      {ma_buffer_s_02[i]=ma_buffer_slow[i]-Points*Point;}
   }
  
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
 
MakarFX:

Hilfe bei der Suche nach einem Fehler

Ich habe dem Indikator zwei Puffer hinzugefügt, aber sie werden nicht im Diagramm angezeigt

Ich habe es versucht - aber ich habe diesehttps://www.mql5.com/ru/code/32179

Semaphore MAMA
Semaphore MAMA
  • www.mql5.com
Cигнальный Индикатор - при пересечении двух МА
 
SanAlex:

Ich habe es versucht - aber ich habe diesehttps://www.mql5.com/ru/code/32179

Gibt es eine für MT4?
 
MakarFX:
Haben Sie eine für mt4?

dieser sollte auch auf mt4 funktionieren - ich werde das jetzt überprüfen, falls etwas ist

--------------------

Ich werde versuchen, es zu beheben - mt4 gibt 6 Fehler

Schnappschuss.PNG

 
SanAlex:

dieser sollte auch auf mt4 funktionieren - ich werde das jetzt überprüfen, falls etwas ist

--------------------

Ich werde versuchen, es zu beheben - mt4 gibt 6 Fehler


Sie können sich meinen Code ansehen, das ist einfacher für mich, es herauszufinden. Ich bin kein Programmierer.
 
MakarFX:
Sie können einen Blick auf meinen Code werfen, es ist einfacher für mich, es herauszufinden. Ich bin kein Programmierer.

Ich habe versucht, Ihren Code zu verstehen, aber ich habe noch nicht herausgefunden, wie man einen Signalindikator für mt4 und mt5 mit zwei MAs erstellt.

https://www.mql5.com/ru/forum/356653#comment_19450441

Индикаторы: Semaphore MAMA
Индикаторы: Semaphore MAMA
  • 2020.11.27
  • www.mql5.com
Статьи и техническая библиотека по автоматическому трейдингу: Индикаторы: Semaphore MAMA
 
MakarFX:

Hilfe bei der Suche nach einem Fehler

Ich habe dem Indikator zwei Puffer hinzugefügt, aber sie werden nicht im Diagramm angezeigt

#Eigenschaft indicator_color3 Schwarz
#property indicator_color4 Schwarz

Ändern Sie die Farbe - schwarz auf schwarz ist nicht sehr schön.

 
MakarFX:
Sie können sich meinen Code ansehen, das ist einfacher für mich, es herauszufinden. Ich bin kein Programmierer.

Hier ist eine funktionierende Version - aber vielleicht haben Sie etwas anderes im Sinn?

//+------------------------------------------------------------------+
//|                                                   MTF_Moving.mq4 |
//|                        Copyright 2017, MetaQuotes Software Corp. |
//|                             https://www.mql5.com/ru/users/melnik |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, MetaQuotes Software Corp."
#property link      "https://www.mql5.com/ru/users/melnik"
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2
#property indicator_width4 2
#property indicator_color1 Wheat
#property indicator_color2 LightSeaGreen
#property indicator_color3 Red
#property indicator_color4 Blue
#property indicator_type1 DRAW_ARROW
#property indicator_type2 DRAW_ARROW
#property indicator_type3 DRAW_LINE
#property indicator_type4 DRAW_LINE

double ma_buffer_slow[];
double ma_buffer_fast[];
double ma_buffer_s_01[];
double ma_buffer_s_02[];

//--- input parameters
input int                     PeriodMaSlow   =21;  //Period slow Ma
input int                     PeriodMaFast   =13;  //Pertiod fast Ma
input ENUM_APPLIED_PRICE      PriceMa        = 0;  //Applied price
input ENUM_MA_METHOD          MethodMa       = 0;  //Method Ma
input ENUM_TIMEFRAMES         Timeframe      =60;  //Timeframe for calculate

ENUM_TIMEFRAMES prd;

int index=-1;
//--- right input parameters flag
bool flag_buy   = false;
bool flag_sell  = false;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   string short_name;
   IndicatorDigits(Digits+1);
   IndicatorBuffers(4);
//--- indicator buffers mapping
   SetIndexBuffer(2, ma_buffer_slow, INDICATOR_DATA);
   SetIndexBuffer(3, ma_buffer_fast, INDICATOR_DATA);
   SetIndexBuffer(0, ma_buffer_s_01, INDICATOR_DATA);
   SetIndexBuffer(1, ma_buffer_s_02, INDICATOR_DATA);
//--- setting the indicator to be drawn as a line
   SetIndexStyle(0,DRAW_ARROW,EMPTY,2,clrWheat);
   SetIndexArrow(0,72);
   SetIndexBuffer(0,ma_buffer_s_01);
   SetIndexStyle(1,DRAW_ARROW,EMPTY,2,clrLightSeaGreen);
   SetIndexArrow(1,71);
   SetIndexBuffer(1,ma_buffer_s_02);
//--- setting the indicator to be drawn as a line
   SetIndexStyle(2,DRAW_LINE,EMPTY,2,clrRed);
   SetIndexBuffer(2,ma_buffer_slow);
   SetIndexStyle(3,DRAW_LINE,EMPTY,2,clrBlue);
   SetIndexBuffer(3,ma_buffer_fast);
//--- setting a name in the DataWindow window and a label
   short_name="MTF_Moving";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
//---
   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[])
  {
//---
   if((rates_total-prev_calculated-PeriodMaSlow)<=0)
      return(0);
   if(Period()>Timeframe)
      prd=PERIOD_CURRENT;
   if(Period()<=Timeframe)
      prd=prd=Timeframe;
   for(int i=rates_total-prev_calculated-PeriodMaSlow-1; i>=0; i--)
     {
      if(TimeMinute(time[i])==0)
         index=iBarShift(Symbol(), prd, time[i], false);
      ma_buffer_fast[i]=iMA(Symbol(), prd, PeriodMaFast, 0, MethodMa, PriceMa, index);
      ma_buffer_slow[i]=iMA(Symbol(), prd, PeriodMaSlow, 0, MethodMa, PriceMa, index);
        {
         if(flag_sell==false)
            //--- check for short position (SELL) possibility
            if(ma_buffer_fast[i]>ma_buffer_slow[i])
              {
               ma_buffer_s_02[i]=Low[i];
               flag_buy=false;
               flag_sell=true;
              }
         if(flag_buy==false)
            //--- check for long position (BUY) possibility
            if(ma_buffer_fast[i]<ma_buffer_slow[i])
              {
               ma_buffer_s_01[i]=High[i];
               flag_buy=true;
               flag_sell=false;
              }
        }
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

--------------------------------------------------------

Und die Signale des Indikators kommen an

rabotaet

 
Wie konvertiert man einen Stochastic-3-Indikator von mt 4 nach mt 5?
 

Meine Grüße an die geschätzte Gemeinschaft!

Kann jemand einen Indikator schreiben, der auf dem Diagramm die Information über die aktuelle Balkenanzahl in einer bestimmten Periode anzeigt, die in den Einstellungen angegeben ist. Der Indikator wird z. B. an Tagen ausgeführt, der Berichtszeitraum ist ein in den Einstellungen angegebener Monat. Das bedeutet, dass der Indikator auf dem Diagramm die Zahl anzeigt, die dem Konto zufolge der Null-Balken vom Beginn des Kalendermonats ist. Auf MT4, bitte)

Frohe Feiertage für alle)

Frohes Jagen)

Grund der Beschwerde: