fxDreema

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

    support and resistence

    General Discussions
    4
    5
    874
    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.
    • S
      skauch last edited by skauch

      hi everyone, i would like to ask if anyone knows how to find support and resistance points with the classic mt4 indicators.
      no pivot point
      thank you
      exemple this code is possible create with a block?

      //+------------------------------------------------------------------+
      //| Support and Resistance.mq5 |
      //| Copyright © 2005, Dmitry |
      //| |
      //+------------------------------------------------------------------+
      #property copyright "Copyright © 2006, MetaQuotes Software Corp."
      #property link "http://www.metaquotes.net/"
      //---- version
      #property version "1.00"
      //---- indicator in the chart window
      #property indicator_chart_window
      //---- 2 indicator buffers are used
      #property indicator_buffers 2
      //---- 2 graphic plots are used
      #property indicator_plots 2
      //+----------------------------------------------+
      //| Bearish indicator options |
      //+----------------------------------------------+
      //---- drawing type as arrow
      #property indicator_type1 DRAW_ARROW
      //---- Magenta color
      #property indicator_color1 Magenta
      //---- Line width
      #property indicator_width1 1
      //---- Support label
      #property indicator_label1 "Support"
      //+----------------------------------------------+
      //| Bullish indicator options |
      //+----------------------------------------------+
      //---- drawing type as arrow
      #property indicator_type2 DRAW_ARROW
      //---- Lime color
      #property indicator_color2 Lime
      //---- Line width
      #property indicator_width2 1
      //---- Resistance label
      #property indicator_label2 "Resistance"

      //+----------------------------------------------+
      //| Indicator input parameters |
      //+----------------------------------------------+
      input int iPeriod=70; // ATR period
      //+----------------------------------------------+

      //---- declaration of dynamic arrays, used as indicator buffers
      double SellBuffer[];
      double BuyBuffer[];
      //---
      int StartBars;
      int FRA_Handle;
      //+------------------------------------------------------------------+
      //| Custom indicator initialization function |
      //+------------------------------------------------------------------+
      void OnInit()
      {
      //---- initialization of global variables
      StartBars=6;
      //---- get handle of the iFractals indicator
      FRA_Handle=iFractals(NULL,0);
      if(FRA_Handle==INVALID_HANDLE)Print(" Íå óäàëîñü ïîëó÷èòü õåíäë èíäèêàòîðà FRA");

      //---- set SellBuffer as indicator buffer
      SetIndexBuffer(0,SellBuffer,INDICATOR_DATA);
      //---- set indxex of starting bar to plot
      PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,StartBars);
      //---- set label for support
      PlotIndexSetString(0,PLOT_LABEL,"Support");
      //---- set arrow char code
      PlotIndexSetInteger(0,PLOT_ARROW,159);
      //---- set indexing as timeseries
      ArraySetAsSeries(SellBuffer,true);

      //---- set BuyBuffer as an indicator buffer
      SetIndexBuffer(1,BuyBuffer,INDICATOR_DATA);
      //---- set index of starting bar to plot
      PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,StartBars);
      //--- set label for resistance
      PlotIndexSetString(1,PLOT_LABEL,"Resistance");
      //---- set arrow char code
      PlotIndexSetInteger(1,PLOT_ARROW,159);
      //---- set indexation as timeseries
      ArraySetAsSeries(BuyBuffer,true);

      //---- set precision
      IndicatorSetInteger(INDICATOR_DIGITS,_Digits);
      //---- indicator short name
      string short_name="Support & Resistance";
      IndicatorSetString(INDICATOR_SHORTNAME,short_name);
      //----
      }
      //+------------------------------------------------------------------+
      //| 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[]
      )
      {
      //---- checking of bars
      if(BarsCalculated(FRA_Handle)<rates_total
      || rates_total<StartBars)
      return(0);

      //---- declaration of local variables
      int to_copy,limit,bar;
      double FRAUp[],FRALo[],upVel,loVel;

      //---- calculation of bars to copy
      //---- and starting index (limit) for bars recalculation loop
      if(prev_calculated>rates_total || prev_calculated<=0)// checking the first call
      {
      to_copy=rates_total; // bars to copy
      limit=rates_total-StartBars-1; // starting index
      }
      else
      {
      to_copy=rates_total-prev_calculated+3; // bars to copy
      limit=rates_total-prev_calculated+2; // starting index
      }

      //---- set indexing as timeseries
      ArraySetAsSeries(FRAUp,true);
      ArraySetAsSeries(FRALo,true);
      ArraySetAsSeries(high,true);
      ArraySetAsSeries(low,true);

      //---- copy indicator data to arrays
      if(CopyBuffer(FRA_Handle,0,0,to_copy,FRAUp)<=0) return(0);
      if(CopyBuffer(FRA_Handle,1,0,to_copy,FRALo)<=0) return(0);

      //---- main loop
      for(bar=limit; bar>=0; bar--)
      {
      BuyBuffer[bar] = 0.0;
      SellBuffer[bar] = 0.0;

         upVel = NormalizeDouble(FRAUp[bar], _Digits);
         loVel = NormalizeDouble(FRALo[bar], _Digits); if(upVel == 0)Print(upVel);
         
         if(upVel != EMPTY_VALUE) BuyBuffer[bar] = high[bar]; else BuyBuffer[bar] = BuyBuffer[bar+1];
         if(loVel != EMPTY_VALUE) SellBuffer[bar] = low[bar]; else SellBuffer[bar] = SellBuffer[bar+1];
       }
      

      //----
      return(rates_total);
      }
      //+------------------------------------------------------------------+

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

        disregard my post

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

          @skauch Yes, you can. But that is not necessary. Just import the custom indicator into your fxDreema account and use it normally with standard blocks.

          (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.

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

            @l-andorrà could you please explain or share a link for tha. i want to import an indicator and then i want to take order on that indicator signals.

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

              @faisalfiaz2002 You can find how to deasl with custom indicators here:

              https://fxdreema.com/documentation/builder/indicators

              Go directly to the second half of the page and read the section titled: '#How To Use Custom Indicators In FxDreema?'

              (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 0
              • 1 / 1
              • First post
                Last post

              Online Users

              E
              R
              S
              A
              B
              N
              M
              A
              T
              V
              M
              A
              A

              25
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors