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 arvidvanstaey, Today, 02:19 PM
    4 responses
    11 views
    0 likes
    Last Post arvidvanstaey  
    Started by samish18, 04-17-2024, 08:57 AM
    16 responses
    60 views
    0 likes
    Last Post samish18  
    Started by jordanq2, Today, 03:10 PM
    2 responses
    9 views
    0 likes
    Last Post jordanq2  
    Started by traderqz, Today, 12:06 AM
    10 responses
    18 views
    0 likes
    Last Post traderqz  
    Started by algospoke, 04-17-2024, 06:40 PM
    5 responses
    47 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X