Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to obtain the way data was loaded for the primary data series.

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

    How to obtain the way data was loaded for the primary data series.

    Hi There,

    I have discovered a range of odd indicator and plot behaviours when a secondary bar series is added by an indicator to a chart for which the primary series was loaded via:
    Load data based on: Bars

    Now I have an indicator that does just that. It loads a secondary data series and calculates plots and values based on the secondary series. To ensure accuracy in my indicator I would like to build in a start-up check in State.Configure where I verify how the data for the primary series was added and throw an exception if it was loaded based on Bars (rather than Days). How would I code this?

    The sudo code is:
    if(State == State.Configure){
    if(BarsArray[0].LoadingMode == LoadingMode.Bars)
    throw new Exception("This indicator is incompatible with a primary series that was loaded via Bars. Please load data based on Days.")
    }

    Thanks

    #2
    Hello ScaleInTrading,

    Thank you for your post.

    You can access this via the BarsPeriod.BarsPeriodType or BarsPeriod.BaseBarsPeriodType.

    Please see the Help Guide documentation below:

    Comment


      #3
      Hi Gaby,

      Thanks for your reply. I am fairly certain the BarsPeriod is the setting applicable to how the chart is displayed but not how the bars were loaded. What I am looking for is the setting "Load data based on" for the data series. It can only take the values Bars, Days or Custom range and determines the amount of data being loaded. It has nothing to do with how the chart is displayed.

      Any other suggestions on how I could access this setting?

      Cheers
      Frank

      Comment


        #4
        Hello Frank,

        My apologies, I misunderstood what you were asking at first. Sorry for the confusion on my part.

        Unfortunately, there is no documented NinjaScript access for the "Load data based on" property.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        627 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        359 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        562 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X