Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical is a liar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Historical is a liar

    Historical returns true when using Zen-Fire demo connection in real-time. Why is that?

    Until now, I have managed to get a false out of it only by using the Market Replay and deleting data history prior to the stream.

    #2
    Do you test from an indicator or strategy?

    Single series or MultiSeries setup?

    Thanks,

    Comment


      #3
      Single series indicator.

      I put the if (Historical) return; at the OBU so when I load the indicator it won't have to iterate all existing bars and instead it will call OBU at each close of a present bar.

      Comment


        #4
        Originally posted by savekad View Post
        Single series indicator.

        I put the if (Historical) return; at the OBU so when I load the indicator it won't have to iterate all existing bars and instead it will call OBU at each close of a present bar.
        Correct, this would then call OBU only on realtime bars as it returns out on historical ones.

        How do you check for the historical condition in your code?

        Comment


          #5
          OnBarUpdate()
          {
          if (Historical)
          {
          ClearOutputWindow();
          Print("Historical data found.");
          return;
          }
          *rest of the code*
          }

          Comment


            #6
            You will see then prints for Historical data of course with this setup. As the OnBarUpdate() runs through the historical chart portion as well before hitting live data.

            Try something like -

            if (Historical)
            return;

            Print(Historical);

            Comment


              #7
              Of course. The thing is that when reaching the real-time bar, it keeps printing and it doesn't executes the code. I waited more for than 3 new bars to be created.

              Comment


                #8
                So what does it print then? True or false?

                Comment


                  #9
                  Damn...

                  Never mind, you were right. It's working now.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  574 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  332 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  101 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  553 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  551 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X