• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 usero86, Today, 04:28 AM
        0 responses
        7 views
        0 likes
        Last Post usero86
        by usero86
         
        Started by bohenriksen, Today, 04:00 AM
        0 responses
        4 views
        0 likes
        Last Post bohenriksen  
        Started by Derjan, Today, 03:09 AM
        0 responses
        5 views
        0 likes
        Last Post Derjan
        by Derjan
         
        Started by CDXTrader, Today, 12:29 AM
        0 responses
        7 views
        0 likes
        Last Post CDXTrader  
        Started by TopGun13, Yesterday, 10:35 PM
        0 responses
        5 views
        0 likes
        Last Post TopGun13  
        Working...
        X