fxDreema

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

    Custom Loop for Testing Moving Averages

    Questions & Answers
    2
    3
    669
    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.
    • K
      kketzal last edited by

      Hi, there!

      I'm trying to do a Custom Loop to check an array of Moving Averages e.g.: (62,100,200,800).
      I want to do a loop for check every MA under certain conditions, so, I need the program flow pass 'N' times ('N' = number of MA in array) I'm using a FOR loop, but the program only test the 62 MA... only test the first element of the array (62)...
      I have seen source code of some FxDreema blocks that do similiar work, and they use FOR loop....

      Can you help me? Any Ideas?
      Thanks in advance.

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

        Arrays are too much for EA builder, so will suggest to create some custom block, starting here: https://fxdreema.com/studio/MQL4
        Use ~next~ where the condition will be true, it's like return, but instead it will be replaced with function calls for the next blocks.

        Or use 4 conditions 🙂

        1 Reply Last reply Reply Quote 0
        • K
          kketzal last edited by

          OK. Sorry. It's solved.
          Yes, I'm using a custom block....the problem was a "indicator Rise/Fail" block...it was with "pass once per bar" parameter selected....that was the problem.

          Thanks!

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

          Online Users

          D
          L
          H
          S
          E

          9
          Online

          146.7k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors