fxDreema

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

    HOW TO EXPLICITLY CONTROL BAR OPENING TIME IN EA

    Questions & Answers
    2
    3
    346
    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.
    • T
      TheLuke last edited by

      Hi everyone,
      I have an EA that I am working on, it is being executed at every tick. I want the functions to be executed at the CLOSE of each bar (say if attached to a one hour chart) and not at every tick. I'd use this piece of code, but how to get something equivalent in fxDreema?
      Thanks in advance ⚡

      bool New_Bar=false;
      //+------------------------------------------------------------------+
      //| expert start function |
      //+------------------------------------------------------------------+
      int start()
      {
      //------------------------------------------------------------------+
      Fun_New_Bar();
      if (New_Bar == false)
      return;
      //------------------------------------------------------------------+
      {

      }
      }
      //+------------------------------------------------------------------+
      void Fun_New_Bar()
      {
      static datetime New_Time = 0;
      New_Bar = false;
      if (New_Time!= Time[0])
      {
      New_Time = Time[0];
      New_Bar = true;
      }
      }
      //-------------------------------------------------------------------+

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

        There is a block called "Once per bar", it does basically the same thing as in your example.

        1 Reply Last reply Reply Quote 0
        • T
          TheLuke last edited by

          Thank you Radoslav. I've tried and it works correctly. Moreover now I get same result for both the testing models ("every tick" and "Open prices only")
          🙂

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

          Online Users

          K
          M
          F
          H
          S
          A
          T

          18
          Online

          146.9k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors