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

Adding DataSeries to Indicator

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

    Adding DataSeries to Indicator

    Hello,

    I was hoping you could help me to add a Data Series to the BarNumbers Indicator I have attached.

    I want to be able to access the bar count through Bloodhound and therefore need a data series to reference the current count.

    Thank you!
    Attached Files

    #2
    Hello fibbee,

    I'm not quite understanding what you are trying to achieve.

    The CurrentBar or CurrentBars[BarsInProgress index] will have the currently processed bar number for the primary or added series.

    For example
    Print(MyIndicator().CurrentBar);

    Below is a publicly available link to the help guide on CurrentBar.



    To add a series to a script use Add(); with the appropriate instrument name, period, and interval.
    Below is a publicly available link to the help guide.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I am trying to add a data series to this indicator so I can use a threshold solver to know when the bar count is greater than or less than a certain number.

      Currently, there is only a plot value that is accessible which serves no benefit inside of Bloodhound.

      I can hack my way around it using other solvers but its sloppy and would be easier if I had an indicator, that counts bars and that data is referenceable by Bloodhound.

      Comment


        #4
        Hello fibbee,

        The Add() method will add a data series to the script so that this historical and real-time data will also cause OnBarUpdate to trigger.

        I'm not certain how this would be used to provide a bar count to bloodhound indicators.

        The CurrentBar object would be the number of the processing bar of the script.

        You can also create a custom series to fill with data.

        Below is a publicly available link to the help guide on this.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DJ888, 04-16-2024, 06:09 PM
        4 responses
        12 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by terofs, Today, 04:18 PM
        0 responses
        6 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by nandhumca, Today, 03:41 PM
        0 responses
        5 views
        0 likes
        Last Post nandhumca  
        Started by The_Sec, Today, 03:37 PM
        0 responses
        3 views
        0 likes
        Last Post The_Sec
        by The_Sec
         
        Started by GwFutures1988, Today, 02:48 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Working...
        X