fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Indicator Compiling error

    Questions & Answers
    2
    5
    680
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AlphaOmega
      AlphaOmega last edited by AlphaOmega

      Morning everyone.. Could someone please help me finding why and fix errors in this indicator when compiling? Thank you
      0_1640506669608_BollingerzFibonacci.mq5
      0_1640506251354_cb1b7588-a2fe-4209-a5f1-26972ddc98c3-image.png

      l'andorrà 1 Reply Last reply Reply Quote 0
      • l'andorrà
        l'andorrà @AlphaOmega last edited by

        @alphaomega I cannot even comipile it on my terminal. Are you sure this is the correct file?

        (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

        (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

        (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

        AlphaOmega 2 Replies Last reply Reply Quote 1
        • AlphaOmega
          AlphaOmega @l'andorrà last edited by AlphaOmega

          @l-andorrà .. Yes it is the correct file.. It starts of like this

          0_1640526771356_e392e6f6-36f2-4e23-84dc-89c4830ffa97-image.png

          //+------------------------------------------------------------------+
          //| Bollinger-Fibonacci.mq5 |
          //| EACompared.com |
          //| http://www.mql5.com |
          //+------------------------------------------------------------------+
          #property copyright "EACompared.com"
          #property link "http://www.mql5.com"
          #property version "1.00"
          #include <MovingAverages.mqh>
          #property indicator_chart_window
          #property indicator_buffers 7
          #property indicator_plots 7
          //--- plot UpperBand3
          #property indicator_label1 "UpperBand3"
          #property indicator_type1 DRAW_LINE
          #property indicator_color1 DarkOliveGreen
          #property indicator_style1 STYLE_SOLID
          #property indicator_width1 1
          //--- plot UpperBand2
          #property indicator_label2 "UpperBand2"
          #property indicator_type2 DRAW_LINE
          #property indicator_color2 DarkGreen
          #property indicator_style2 STYLE_DASH
          #property indicator_width2 1
          //--- plot UpperBand1
          #property indicator_label3 "UpperBand1"
          #property indicator_type3 DRAW_LINE
          #property indicator_color3 SeaGreen
          #property indicator_style3 STYLE_DASH
          #property indicator_width3 1
          //--- plot MidPoint
          #property indicator_label4 "MidPoint"
          #property indicator_type4 DRAW_LINE
          #property indicator_color4 DarkBlue
          #property indicator_style4 STYLE_SOLID
          #property indicator_width4 1
          //--- plot LowerBand1
          #property indicator_label5 "LowerBand1"
          #property indicator_type5 DRAW_LINE
          #property indicator_color5 SeaGreen
          #property indicator_style5 STYLE_DASH
          #property indicator_width5 1
          //--- plot LowerBand2
          #property indicator_label6 "LowerBand2"
          #property indicator_type6 DRAW_LINE
          #property indicator_color6 DarkGreen
          #property indicator_style6 STYLE_DASH
          #property indicator_width6 1
          //--- plot LowerBand3
          #property indicator_label7 "LowerBand3"
          #property indicator_type7 DRAW_LINE
          #property indicator_color7 DarkOliveGreen
          #property indicator_style7 STYLE_SOLID
          #property indicator_width7 1
          //--- input parameters
          input ENUM_APPLIED_PRICE Pr=PRICE_CLOSE;
          input int Periods=20;
          input ENUM_MA_METHOD MAType=MODE_SMA;
          input float Factor1=1.618;
          input float Factor2=2.618;
          input float Factor3=4.236;
          //--- input parameters
          input int InpAtrPeriod=14; // ATR period
          //--- indicator buffers

          //--- global variable
          int ExtPeriodATR;
          int ExtBandsPeriod;
          int ExtPlotBegin=0;
          //--- indicator buffers
          double UpperBand3Buffer[];
          double UpperBand2Buffer[];
          double UpperBand1Buffer[];
          double MidPointBuffer[];
          double LowerBand1Buffer[];
          double LowerBand2Buffer[];
          double LowerBand3Buffer[];
          double ExtATRBuffer[];
          double ExtTRBuffer[];

          //+------------------------------------------------------------------+
          //| Custom indicator initialization function |
          //+------------------------------------------------------------------+
          int OnInit()
          {
          //--- check for input values
          if(Periods<2)
          {
          ExtBandsPeriod=20;
          printf("Incorrect value for input variable Periods=%d. Indicator will use value=%d for calculations.",Periods,ExtBandsPeriod);
          }
          else ExtBandsPeriod=Periods;
          //--- indicator buffers mapping
          SetIndexBuffer(0,ExtATRBuffer,INDICATOR_CALCULATIONS);
          SetIndexBuffer(1,ExtTRBuffer,INDICATOR_CALCULATIONS);
          SetIndexBuffer(0,UpperBand3Buffer,INDICATOR_DATA);
          SetIndexBuffer(1,UpperBand2Buffer,INDICATOR_DATA);
          SetIndexBuffer(2,UpperBand1Buffer,INDICATOR_DATA);
          SetIndexBuffer(3,MidPointBuffer,INDICATOR_DATA);
          SetIndexBuffer(4,LowerBand1Buffer,INDICATOR_DATA);
          SetIndexBuffer(5,LowerBand2Buffer,INDICATOR_DATA);
          SetIndexBuffer(6,LowerBand3Buffer,INDICATOR_DATA);
          //--- set index labels
          PlotIndexSetString(0,PLOT_LABEL,"Bands("+string(ExtBandsPeriod)+") Middle");
          PlotIndexSetString(3,PLOT_LABEL,"Bands("+string(ExtBandsPeriod)+") Upper");
          PlotIndexSetString(6,PLOT_LABEL,"Bands("+string(ExtBandsPeriod)+") Lower");
          //--- indicator name
          IndicatorSetString(INDICATOR_SHORTNAME,"BB-Fibonacci");
          //--- indexes draw begin settings
          ExtPlotBegin=ExtBandsPeriod-1;
          PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,ExtBandsPeriod);
          PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,ExtBandsPeriod);
          PlotIndexSetInteger(2,PLOT_DRAW_BEGIN,ExtBandsPeriod);
          PlotIndexSetInteger(3,PLOT_DRAW_BEGIN,ExtBandsPeriod);
          PlotIndexSetInteger(4,PLOT_DRAW_BEGIN,ExtBandsPeriod);
          PlotIndexSetInteger(5,PLOT_DRAW_BEGIN,ExtBandsPeriod);
          PlotIndexSetInteger(6,PLOT_DRAW_BEGIN,ExtBandsPeriod);
          //--- number of digits of indicator value
          IndicatorSetInteger(INDICATOR_DIGITS,_Digits+1);
          //---
          return(0);
          }
          //+------------------------------------------------------------------+
          //| 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 &TickVolume[],
          const long &Volume[],
          const int &Spread[],
          const int begin,
          const double &price[])
          {
          //--- variables
          int pos;
          //--- indexes draw begin settings, when we've recieved previous begin
          if(ExtPlotBegin!=ExtBandsPeriod+begin)
          {
          ExtPlotBegin=ExtBandsPeriod+begin;
          PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,ExtPlotBegin);
          PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,ExtPlotBegin);
          PlotIndexSetInteger(2,PLOT_DRAW_BEGIN,ExtPlotBegin);
          PlotIndexSetInteger(3,PLOT_DRAW_BEGIN,ExtPlotBegin);
          PlotIndexSetInteger(4,PLOT_DRAW_BEGIN,ExtPlotBegin);
          PlotIndexSetInteger(5,PLOT_DRAW_BEGIN,ExtPlotBegin);
          PlotIndexSetInteger(6,PLOT_DRAW_BEGIN,ExtPlotBegin);
          }
          {
          int i,limit;
          //--- check for bars count
          if(rates_total<=ExtPeriodATR)
          return(0); // not enough bars for calculation
          //--- preliminary calculations
          if(prev_calculated==0)
          {
          ExtTRBuffer[0]=0.0;
          ExtATRBuffer[0]=0.0;
          //--- filling out the array of True Range values for each period
          for(i=1;i<rates_total;i++)
          ExtTRBuffer[i]=MathMax(High[i],Close[i-1])-MathMin(Low[i],Close[i-1]);
          //--- first AtrPeriod values of the indicator are not calculated
          double firstValue=0.0;
          for(i=1;i<=ExtPeriodATR;i++)
          {
          ExtATRBuffer[i]=0.0;
          firstValue+=ExtTRBuffer[i];
          }
          //--- calculating the first value of the indicator
          firstValue/=ExtPeriodATR;
          ExtATRBuffer[ExtPeriodATR]=firstValue;
          limit=ExtPeriodATR+1;
          }
          else limit=prev_calculated-1;
          //--- the main loop of calculations
          for(i=limit;i<rates_total;i++)
          {
          ExtTRBuffer[i]=MathMax(High[i],Close[i-1])-MathMin(Low[i],Close[i-1]);
          ExtATRBuffer[i]=ExtATRBuffer[i-1]+(ExtTRBuffer[i]-ExtTRBuffer[i-ExtPeriodATR])/ExtPeriodATR;
          }
          //--- return value of prev_calculated for next call
          return(rates_total);
          }

          //--- check for bars count
          if(rates_total<ExtPlotBegin)
          {

            return(0);
           }
          

          //--- starting calculation
          if(prev_calculated>1) pos=prev_calculated-1;
          else pos=0;
          //--- main cycle
          for(int i=pos;i<rates_total;i++)
          {
          //--- middle line
          MidPointBuffer[i]=SimpleMA(i,ExtBandsPeriod,price);
          //--- upper band 3
          UpperBand3Buffer[i]=MidPointBuffer[i]+(Factor3ExtATRBuffer[i]);
          //--- upper band 2
          UpperBand3Buffer[i]=MidPointBuffer[i]+(Factor2
          ExtATRBuffer[i]);
          //--- upper band 1
          UpperBand3Buffer[i]=MidPointBuffer[i]+(Factor1ExtATRBuffer[i]);
          //--- lower band 1
          LowerBand1Buffer[i]=MidPointBuffer[i]-(Factor1
          ExtATRBuffer[i]);
          //--- lower band 2
          LowerBand2Buffer[i]=MidPointBuffer[i]-(Factor2ExtATRBuffer[i]);
          //--- lower band 3
          LowerBand3Buffer[i]=MidPointBuffer[i]-(Factor3
          ExtATRBuffer[i]);
          //---
          }
          //---- OnCalculate done. Return new prev_calculated.
          return(rates_total);
          }

          //---
          0_1640526922467_0d70f8a2-ec14-4be0-ac13-512ae8f38194-image.png

          1 Reply Last reply Reply Quote 0
          • AlphaOmega
            AlphaOmega @l'andorrà last edited by

            @l-andorrà I found another one that is working.. Thank you
            https://www.mql5.com/en/code/18034

            l'andorrà 1 Reply Last reply Reply Quote 0
            • l'andorrà
              l'andorrà @AlphaOmega last edited by

              @alphaomega Thank you for sharing.

              (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

              (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

              (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

              1 Reply Last reply Reply Quote 1
              • 1 / 1
              • First post
                Last post

              Online Users

              T
              S
              A
              M
              R
              G
              G
              Y
              C
              S
              S
              S

              22
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors