fxDreema

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

    Array out of range at OnTradeDetector()

    Bug Reports
    5
    5
    2732
    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
      Sapiens last edited by

      Recentrly encountered a problem when my FXDreema experts had crushed with "array out of range" error:
      "2019.03.04 12:35:24.643 MyExpertMT5 (GOLD-3.19,M5) array out of range in '10848-53731.mq5' (20460,26)"

      When I checked the code it appeared to be Dreema's function: bool OnTradeDetector().
      To be percise its 245 line:
      if (EGV_PositionsList0[i].type != EGV_PositionsList[i].type)

      Has anyone had such a problem or knows how to cope with it?

      1 Reply Last reply Reply Quote 0
      • D
        Dieter last edited by

        Dear Sapiens,

        I have a similar problem:

        https://fxdreema.com/forum/topic/6858/big-problem-array-out-of-range-3297-29

        I can not find a solution.

        E 1 Reply Last reply Reply Quote 1
        • E
          eklonsousa @Dieter last edited by

          @dieter I'm also facing this issue

          alt text

          The tester raised the error on 688,29 line

          2019.06.25 09:04:41.871 2015.01.26 00:00:01 Project1 US30,H4: array out of range in 'Project1.mq4' (688,29)

          1 Reply Last reply Reply Quote 0
          • A
            anse33 last edited by

            Same here. Error "array out of range" referring to the following lines:

            UpdateEventValues(EGV_OrderList[OrdersTotal()-1],"new","");
            or
            if (EGV_PositionsList0[i].type != EGV_PositionsList[i].type)
            or
            if ((EGV_OrderList0[i].sl != EGV_OrderList[i].sl) && (EGV_OrderList0[i].tp != EGV_OrderList[i].tp)) {

            Same EA, different times. Unfortunately, this error can not be reproduced in Strategy Tester. Occures only in realtime trading (demo & real). Happens faster if more EAs are running at the same time. Found no solution so far. This stopped me from using fxDreema & EAs a long time ago.

            roar 1 Reply Last reply Reply Quote 0
            • roar
              roar @anse33 last edited by

              @anse33 Square brackets refer to individual array elements. For example, array[1] will return the second element for an array, because the indexing starts at 0.

              Now, if there are no open orders, OrdersTotal() will be 0.
              This:
              [OrdersTotal()-1]
              will return value of -1. Arrays don't have negative indexes - its out of array range.

              Try adding a trade count filter before the block in question.

              Need small help? Tag me in your post
              Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

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

              Online Users

              E
              S
              M
              2
              M
              M

              23
              Online

              146.6k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors