fxDreema

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

    VERY VERY Stupid error!!!

    Bug Reports
    2
    3
    926
    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.
    • D
      Didble trader last edited by Didble trader

      Hello Fx dreema,

      I want to report a problem. Please follow these steps.

      1. go to this link
        https://fxdreema.com/shared/AA0jy8Usb

      2. download into your MT4 terminal for back testing.

      3. Press start

      Now appears the problem. It will show a text "error" and indeed it is an error because the first tick is NOT above "first_level_up" (this is a variable.)

      But the funny thing is that if you stop the back testing and press again START, now, the second time, is will NOT appear this error.

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

        Try this EA:

        bool printed = false;
        
        void OnTick()
        {
           if (printed == true) {ExpertRemove(); return;}
           printed = true;
         
           Print("Value 1 = " + iClose(Symbol(), PERIOD_D1, 0));
           Print("Value 2 = " + iClose(Symbol(), PERIOD_D1, 0));
           Print("Value 3 = " + iClose(Symbol(), PERIOD_D1, 0));
           Print("Value 4 = " + iClose(Symbol(), PERIOD_D1, 0));
           Print("Value 5 = " + iClose(Symbol(), PERIOD_D1, 0));
        }
        
        1. Close MetaTrader
        2. Open MetaTrader
        3. Run the EA in the Tester using timeframe that is NOT Daily

        The result is like this: http://prntscr.com/e8pnvm

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

          If I make it like this, it fixes the problem also for other timeframes:

          bool printed = false;
          
          void OnInit()
          {
             iClose(Symbol(), PERIOD_M1, 0);
             iClose(Symbol(), PERIOD_M1, 0);
             iClose(Symbol(), PERIOD_M5, 0);
             iClose(Symbol(), PERIOD_M5, 0);
             iClose(Symbol(), PERIOD_M15, 0);
             iClose(Symbol(), PERIOD_M15, 0);
             iClose(Symbol(), PERIOD_M30, 0);
             iClose(Symbol(), PERIOD_M30, 0);
             iClose(Symbol(), PERIOD_H1, 0);
             iClose(Symbol(), PERIOD_H1, 0);
             iClose(Symbol(), PERIOD_H4, 0);
             iClose(Symbol(), PERIOD_H4, 0);
             iClose(Symbol(), PERIOD_D1, 0);
             iClose(Symbol(), PERIOD_D1, 0);
          }
          
          void OnTick()
          {
             if (printed == true) {ExpertRemove(); return;}
             printed = true;
           
             Print("Value 1 = " + iClose(Symbol(), PERIOD_D1, 0));
             Print("Value 2 = " + iClose(Symbol(), PERIOD_D1, 0));
             Print("Value 3 = " + iClose(Symbol(), PERIOD_D1, 0));
             Print("Value 4 = " + iClose(Symbol(), PERIOD_D1, 0));
             Print("Value 5 = " + iClose(Symbol(), PERIOD_D1, 0));
          }
          

          ... but it makes the EA to start slow and probably uses more resources, because it loads all timeframes. So I don't want to use this fix in fxDreema

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

          Online Users

          H
          S
          S
          C
          F
          S
          R
          M

          20
          Online

          146.8k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors