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

Using custom indicator in custom strategy code (NT7)

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

    Using custom indicator in custom strategy code (NT7)

    Hello,

    I need to ask you, i have my own custom indicator CCPAC.cs (see attachement) and its simple indicator calculating highest high and lowest low N bars back on some user definied market.
    You can insert this indicator to $EURUSD chart and you will set properties of this indicator "$GBPUSD", so you will see $GBPUSD highest high and howest low on $EURUSD chart. I guess its clear..
    These values are set to plots.
    So there are two GET SET methods:


    Code:
    [Browsable(false)]
            [XmlIgnore()]
            public DataSeries Plot0_PACup
            {
                get { return Values[0]; }
            }
            [Browsable(false)]
            [XmlIgnore()]
            public DataSeries Plot1_PACdown
            {
                get { return Values[1]; }
            }
    And now... I need to create strategy which will run on $EURUSD market but will use this indicator and his calculated values but the indicator is set for "$GBPUSD".
    So in other words.. I need to run strategy on $EURUSD, and this strategy will use calculated values of my indicator and this indicator's values are related to $GBPUSD.

    What is the syntax of this?
    What should I write to Add method to the strategy?
    I know that with Add method i can import the indicator to the strategy and the plots will be visible when the strategy run, but I also need USE the values of the plots of the imported indicator? How to do that?

    Thank you
    Attached Files

    #2
    Hi zooinek,

    You can access your multi-series indicator from a strategy with something like...

    IndicatorName().Plot0_PACup[0]
    TimNinjaTrader Customer Service

    Comment


      #3
      Hello,

      but your advice is not working...
      I tried to use
      Code:
      double value = CCPAC("$EURUSD", PeriodType.Minute, 60, 5).Plot0_PACup[0];
      but there's error while compiling. I have language localization so I tried to translate the exception message:

      NinjaTrader.Indicator.CCPAC is type, but is using like variable.

      What it means?

      Comment


        #4
        Hello Zooinek,

        The file you attached is missing the section below:

        #region
        NinjaScript generated code. Neither change nor remove.
        //lots of useful stuff here.
        #endregion


        You will have to recreate your indicator using the wizard and be sure not to delete any of this.
        Last edited by NinjaTrader_RyanM1; 05-07-2010, 04:30 PM.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by xiinteractive, 04-09-2024, 08:08 AM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Johnny Santiago, 10-11-2019, 09:21 AM
        95 responses
        6,193 views
        0 likes
        Last Post xiinteractive  
        Started by Irukandji, Today, 09:34 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by RubenCazorla, Today, 09:07 AM
        1 response
        6 views
        0 likes
        Last Post RubenCazorla  
        Started by TraderBCL, Today, 04:38 AM
        3 responses
        26 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X