fxDreema

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

    Count the number of bars of indicator I_XO_A_H

    Questions & Answers
    2
    2
    744
    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.
    • C
      ClauTrade last edited by

      Hi, please need support.

      I use I_XO_A_H indicator in a EA, it have 2 buffers, one for green bar and one for red bar. The buffers value output are multiples of 1 (1,2,3,4,5...etc for green) or -1 (-1,-2,-3,-4, ...etc for red). The value define the amplitude of bars.

      I need of a variable, formula or something "TO COUNT THE Nº OF BAR WITH X VALUE ...

      http://screencast.com/t/Ci2d6os0
      http://screencast.com/t/Ci2d6os0

      In this case, at moment of signal I need to count the last nº of bar with buffer value 8. (in this case are 11).

      I need it to use a filter to get off the entry. For example: IF THE Nº of LAST BAR VALUE 8 ARE < 20 - THEN - DO NOT OPEN TRADE

      How can I do it?
      Thanks, regards!

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

        Unfortunately the EA builder is weak when it comes to mathematical calculations, this thing is normally done by the indicators themselves.

        It's easier to write such a custom code instead of building it with blocks, because this some normal "for" or "while" loop with few extra variables to control it. I don't know how to make things like this with blocks... I mean... there are already some loops available (for example this big category with pink blocks), but many people have problems understanding how to deal with this, even if it's not that complicated.

        Otherwise in some loop you want to check indicator values for the last candles, having some variable to count and starting from 0. When the detected value is lower/bigger than something - break the loop. Then use the value from the counter. Additionaly, to optimize things, add some "once per bar" functionality. Or something else.

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

        Online Users

        M
        M
        S
        G
        E
        N
        A
        C
        M
        M
        M
        E

        25
        Online

        146.7k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors