fxDreema

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

    How to set Engulfing like that, candle id 1 wick engulf candle id 2.. almost try but still fail,,

    Questions & Answers
    3
    5
    576
    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.
    • M
      mywife last edited by

      2_1651042375481_Screenshot_10.jpg 1_1651042375480_Screenshot_8.jpg 0_1651042375479_Screenshot_6.jpg bolded text

      A 1 Reply Last reply Reply Quote 0
      • A
        ambrogio @mywife last edited by

        @mywife did you search the forum? There are tons of examples to get inspiration from

        M 1 Reply Last reply Reply Quote 0
        • M
          mywife @ambrogio last edited by mywife

          @ambrogio I did and try many time but still not same
          .
          .
          I don't know to read this..
          .
          .
          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[])
          {
          int limit = rates_total - prev_calculated;
          //--- counting from 0 to rates_total
          ArraySetAsSeries(Buffer1, true);
          //--- initial zero
          if(prev_calculated < 1)
          {
          ArrayInitialize(Buffer1, EMPTY_VALUE);
          }
          else
          limit++;

          //--- main loop
          for(int i = limit-1; i >= 0; i--)
          {
          if (i >= MathMin(5000-1, rates_total-1-50)) continue; //omit some old rates to prevent "Array out of range" or slow calculation

            //Indicator Buffer 1
            if(Low[1+i] > Low[i] //Candlestick Low > Candlestick Low
            && High[1+i] < High[i] //Candlestick High < Candlestick High
            )
              {
               Buffer1[i] = Low[i]; //Set indicator value at Candlestick Low
               if(i == 0 && Time[0] != time_alert) { myAlert("indicator", "Buy"); time_alert = Time[0]; } //Instant alert, only once per bar
              }
            else
              {
               Buffer1[i] = EMPTY_VALUE;
              }
           }
          

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

          1 Reply Last reply Reply Quote 0
          • TipsyWisdom
            TipsyWisdom last edited by

            im not exactly sure what the problem is. I see you pointing to candle ID's and saying engulfing, I see a trade but you haven't explained what you are trying to achieve and whats failing.

            1 Reply Last reply Reply Quote 0
            • TipsyWisdom
              TipsyWisdom last edited by

              0_1651060722363_43cdef95-e622-412d-b7b2-fbc1113b62ad-image.png

              0_1651060741580_a4a071c6-f580-4fea-8de0-3721e0813a3c-image.png
              0_1651060751943_0268e848-b043-41b9-bf42-ad64bb2a0ac6-image.png
              0_1651060770072_0a7a111e-841b-48af-abf0-189c19147a8d-image.png

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

              Online Users

              D
              E
              M
              H
              C
              I
              I
              E

              26
              Online

              146.6k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors