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 cmoran13, 04-16-2026, 01:02 PM
        0 responses
        43 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        25 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        162 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X