Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Get ISeries from BarSeries in Add-On

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

    Get ISeries from BarSeries in Add-On

    I am developing an add-on in which I am defining two bar series using BarsRequest.

    I would like to find an EMA value of the Highs for each of the two bar series.

    How do I get an ISeries (which I can use in the EMA function) from a BarSeries?

    Thanks!


    #2
    Hello kenconcannon,

    Thanks for your post.

    So I may accurately assist, could you please provide a brief description of what exactly you are wanting to accomplish?

    For example, are you wanting to get the EMA value in a script similar to getting the high value using BarSeries.GetHigh(index)?

    I look forward to assisting further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi Brandon,

      I am trying to create an add-on which determines the trend and correlation of multiple instruments.

      I want to be able to use functions that require I pass it an ISeries (such as High, Low, Typical, etc.)

      I know I can use the GetHigh() for an individual bar with the BarRequest object, I was hoping to get the same ISeries that I would use in a strategy or indicator. Currently I am thinking that I have to create the list by going through each bar on the BarRequest object and populating the ISeries list that I would create.

      Before I went down this route I thought I would inquire if there was a better way.

      Comment


        #4
        Hello kenconcannon,

        Thanks for the clarification.

        No, BarRequest returns an array of data and subscribed to the market data. ISeries are part of indicators, strategies chart objects, etc. An addon has no concept of "bar" you would need to write your own logic that does your own math based on the array of data that is available to do an EMA.

        Since there is no concept of a series<T> in an addon, you would need to just use regular math based on the data available.

        Series<T> requires being configured in a specific way from chart scripts so you wouldn't be able to use that type. You could manually calculate what you need but you cannot pass that data to existing indicators or anything that takes a series.

        Please let me know if I may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        59 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        36 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        21 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        10 views
        0 likes
        Last Post cre8able  
        Working...
        X