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

Accessing other indicator boolean values

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

    Accessing other indicator boolean values

    Hi,

    I'm trying to access a boolean series from another indicator...
    I've set up the Boolean series for values to be accessed.
    As per SampleBoolSeries Indicator.

    When I type in this line of code Add(SMAgroup2()); in my indicator that will be
    accessing the boolean series I get a No overload for method...takes '0' arguments.

    protectedoverridevoid Initialize()
    {

    Add(
    new Plot(new Pen(Color.Lime, 2), PlotStyle.Bar, "UpVolume"));
    Add(
    new Plot(new Pen(Color.Red, 2), PlotStyle.Bar, "DownVolume"));
    Add(
    new Line(Color.DarkGray, 0, "Zero line"));

    DrawOnPricePanel=
    false;


    Add(SMAgroup2()); // This is the line


    }

    Obviuosly the indicator I'm accessing is named SMAgroup2:Indicator.

    I thought if it took o arguments then typing in () would be ok?

    I'm using NT7..



    Thanks
    Bruce

    #2
    Originally posted by tacticaltrader View Post
    Hi,

    I'm trying to access a boolean series from another indicator...
    I've set up the Boolean series for values to be accessed.
    As per SampleBoolSeries Indicator.

    When I type in this line of code Add(SMAgroup2()); in my indicator that will be
    accessing the boolean series I get a No overload for method...takes '0' arguments.

    protectedoverridevoid Initialize()
    {

    Add(
    new Plot(new Pen(Color.Lime, 2), PlotStyle.Bar, "UpVolume"));
    Add(
    new Plot(new Pen(Color.Red, 2), PlotStyle.Bar, "DownVolume"));
    Add(
    new Line(Color.DarkGray, 0, "Zero line"));

    DrawOnPricePanel=
    false;


    Add(SMAgroup2()); // This is the line


    }

    Obviuosly the indicator I'm accessing is named SMAgroup2:Indicator.

    I thought if it took o arguments then typing in () would be ok?

    I'm using NT7..



    Thanks
    Bruce
    If you coded SMAgroup2 by starting with the wizard, the wizard created at least one class variable, usually called MyInput0.

    If you are not using the variable, you can edit the SMAgroup2.cs file to remove it. Otherwise, to reference the indicator, you must give it the required int input. Try SMAgroup2(0).

    Your other option is to create a new named instance of the indicator, then reference that instance. Actually, if you are using COBC = false, that may be the most efficient method to use the indicator, as it bypasses NT's iteration through the app domain to find the correct running instance, which of course happens every time the indicator is called. Think what happens when the indicator is called 1 million times on one bar because COBC is false.
    Last edited by koganam; 09-27-2011, 11:18 AM.

    Comment


      #3
      Hi,

      The indicator is the VolumeUpDown indicator supplied by NT...I've basically copied and pasted
      into a new indicator called VolumeAnalyzer and added some extra code. I need to access
      another indicator called SMAgroup2 so I created a Boolean Series within that.And now I want
      to reference that series from within VolumeAnalyzer.cs
      SMAgroup2(0) doesn't work. There is limited information on this topic.
      Is the problem with the VolumeAnalyzer or SMAgroup2 indicator..what do you think?

      A couple of error messages I get when I add this line ADD(SMAgroup2()) are...

      1. No overloaded method SMAgroup2 takes 1 arguments
      2. Argument 1 cannot convert from NT.Indicator.SMAgroup2 to NT.GUI Chart.Line

      Thanks
      Bruce

      Comment


        #4
        Bruce, can you please zip up the indicators you're trying to work with then send them to us at support at ninjatrader dot com so we can take a look?

        Thanks,
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by JonesJoker, 04-22-2024, 12:23 PM
        8 responses
        41 views
        0 likes
        Last Post JonesJoker  
        Started by timko, Today, 06:45 AM
        0 responses
        3 views
        0 likes
        Last Post timko
        by timko
         
        Started by Waxavi, 04-19-2024, 02:10 AM
        2 responses
        39 views
        0 likes
        Last Post poeds
        by poeds
         
        Started by chbruno, Yesterday, 04:10 PM
        1 response
        44 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Max238, Today, 01:28 AM
        1 response
        25 views
        0 likes
        Last Post CactusMan  
        Working...
        X