Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator doesn't update on each tick

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

    Indicator doesn't update on each tick

    Hi,
    I am developing an indicator. I have included a data series of 1 month:
    AddDataSeries("", new BarsPeriod { BarsPeriodType = BarsPeriodType.Month, Value = 1 }, 15, "", false);

    I have also used:
    Calculate = Calculate.OnEachTick;

    Then when I try to print the time onbarupdate:
    if(BarsInProgress == 1) {
    Print(Time[0]);
    }

    the result is:
    31/07/2020 23:00:00
    31/08/2020 23:00:00
    30/09/2020 23:00:00
    30/10/2020 22:00:00
    30/11/2020 23:00:00
    31/12/2020 23:00:00
    29/01/2021 23:00:00
    26/02/2021 23:00:00
    31/03/2021 23:00:00
    30/04/2021 23:00:00
    31/05/2021 19:00:00
    30/06/2021 23:00:00
    30/07/2021 23:00:00

    Why it is onlyupdate on bar close and no on each tick?

    Thanks


    #2
    Hello lju45,

    The Time series represents the timestamps of the bars, you won't get any more granular timestamps when using Time[0] OnEachTick. You are using a monthly series so you should see the times of the month only.

    If you wanted a more granular time where you have shown you would need to add a 1 tick series and then use the appropriate Times[2][0] to access the last ticks time.

    I look forward to being of further assistance.

    Comment


      #3
      Thanks,


      I need to calculate the high of the last 12 month and I'm using: Highs[1][HighestBar(Highs[1], 12)])
      but it is only update at the end of the month, how can I make to be update on each tick?

      Comment


        #4
        Hello lju45,

        To have OnBarUpdate called OnEachTick you would set the script to OnEachTick for its Calculate property. Keep in mind that OnEachTick is only relevant in realtime, if those are historical prints that would be correct. Historical bars process OnBarClose.

        In Realtime for the building bar you would see each tick call OnBarUpdate and the Print(Time[0]) should keep outputting the same monthly bar time, the monthly bars time did not change between two ticks.


        I look forward to being of further assistance.

        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
        333 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