Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting My highs and Lows....

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

    Getting My highs and Lows....

    Hello Everyone:

    I am Trying to Obtain Highs and Lows and save them on a DataBase. But I want to Go Back on Historical Data certain amount of Bars. According to my Logic, If I do it on Bar Update, Every time there is a new Bar, it will do the same cycle over and over again. I don't Want the system to do that.

    I would like it to review historical data when the strategy opens. then start adding values from real time data. Can I do a cycle from 0 to current Bar Under the Initialize(), then continue to add on Bar Update. or Would it be better to do a cycle for Instances of Zig Zag indicator.

    #2
    Yandychang, the Initialize() would not be a good place since it could be called multiple times and bars data could not be accessed here. You could detect the last current bar when loading the script in historical and then do your processing once to be ready for the subsequent realtime bars to add.

    Comment


      #3
      Thank you, that was my question. I saw something in the past along the lines of....

      If (historical)
      {
      Go back and get highs and lows
      }



      Is this what you suggest?

      Comment


        #4
        Correct, you may also want to include a check to do this only on the last loaded bar, i.e. if CurrentBar == Count -2

        Comment


          #5
          Got it, thank you very much... Your help is appreciated

          Comment

          Latest Posts

          Collapse

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