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

Reading DataSeries information from another indicator

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

    Reading DataSeries information from another indicator

    I have an indicator (IndicatorA) that is trying to read DataSeries information from another indicator (IndicatorB). IndicatorB has a DataSeries in it called DataSeriesB.

    I have written the following code in IndicatorA :

    Code:
     
    if(IndicatorB().DataSeriesB.ContainsValue(0) == true)
          BarColor = Color.Blue;
    I have also tried

    Code:
     
    if(IndicatorB.DataSeriesB.ContainsValue(0) == true)
          BarColor = Color.Blue;
    IndicatorA is supposed to color the bar blue if there is a valid data point for that bar in IndicatorB. Unfortunately, neither of the above codes work and I get an error message (CS1501). Neither IndicatorA or IndicatorB have input parameters.

    Does anyone know how to correct this problem?

    #2
    h1000, I would suggest checking into this sample here to see the recommended usage model to expose anything that's not a plot, like your custom signal series here - http://www.ninjatrader.com/support/f...ead.php?t=4991
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand, thanks for the link.

      After studying the BoolSeries example, I made some changes to the code, but still an error exists. It appears that my indicator (IndicatorB) reflects the overall context of the BoolSeries example, so I am not certain why the error is occurring.

      The specific error is NinjaTrader.Indicator.Inidcator.IndicatorB() is a 'method', which is not valid in the given context. The error itself occurs in IndicatorA

      Does anyone know how to correct this error?

      Attached are IndicatorA and IndicatorB. Please note, you will have to decomment the code in the OnBarUpdate section of IndicatorA to get the error message.
      Attached Files

      Comment


        #4
        All though you have no arguments to pass, you still need to format IndicatorB as a Method()

        Code:
        			if(IndicatorB().DataSeriesB.ContainsValue(0) == true )
        					BarColor = Color.Blue;
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by RubenCazorla, 08-30-2022, 06:36 AM
        3 responses
        77 views
        0 likes
        Last Post PaulMohn  
        Started by f.saeidi, Yesterday, 12:14 PM
        9 responses
        23 views
        0 likes
        Last Post f.saeidi  
        Started by Tim-c, Today, 03:54 AM
        0 responses
        3 views
        0 likes
        Last Post Tim-c
        by Tim-c
         
        Started by FrancisMorro, Today, 03:24 AM
        0 responses
        4 views
        0 likes
        Last Post FrancisMorro  
        Started by Segwin, 05-07-2018, 02:15 PM
        10 responses
        1,772 views
        0 likes
        Last Post Leafcutter  
        Working...
        X