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

Passing values between indicators using intSeries

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

    Passing values between indicators using intSeries

    I am attempting to pass values from one indicator to another using intSeries. I followed the code in the BoolSeries example and managed to get the “called” indicator to store the needed int values in the intSeries structures. However, I’ve encountered a problem getting the “calling” indicator to compile correctly. The called indicator runs in the Input series panel and the other will run in any other panel.

    I generated a shell indicator using the Wizard, did not specify any input parameters and only 1 plot series, all of which compiled clean. However when I attempted to include the calling indicator following the example in the BoolSeriesSample (which is a strategy) I encountered 2 compile errors. The format of the Add as per the sample is:

    Add(myIndicator());

    The error messages I received are:

    1. Indicator\MyCustomIndicator.cs The best overloaded method match for 'NinjaTrader.Indicator.IndicatorBase.Add(NinjaTrad er.Gui.Chart.Line)' has some invalid arguments CS1502

    2. Indicator\MyCustomIndicator.cs Argument '1': cannot convert from 'NinjaTrader.Indicator.myIndicator' to 'NinjaTrader.Gui.Chart.Line' CS1503

    As best as I can determine a parameter needs to be included in the Add (I tried “void” with no success). Mousing over the indicator name displays a tip box which indicates there is +1 overload available. Unlike others that I’ve seen that allow one to scroll though the various overloads available this tip box disappears as soon as the mouse is moved.

    I gather that the overload is generate when the called indicator is compiled and the necessary arguments are somehow determined.

    So, all that said:

    • how do I determine what needs to be included in the Add method, and
    • if parameters are passed to the called indicator will they override it’s current settings (which I do not want)?


    I am neither a NinjaScript or C# programmer so I appreciate any given help.

    Thank you

    #2
    Cheech, thanks for the post - only strategies could add indicators in for display. This would not be possible in an indicator script. And to access exposed values, this would also not be needed - you can directly call the exposed / variable / series or plot in your script to access.

    i.e. MyIndicator().MyCustomSeriesExposed[0]
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    148 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    5 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    5 views
    0 likes
    Last Post tkaboris  
    Started by GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,282 views
    0 likes
    Last Post Leafcutter  
    Working...
    X