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 trilliantrader, 04-18-2024, 08:16 AM
        4 responses
        18 views
        0 likes
        Last Post trilliantrader  
        Started by mgco4you, Today, 09:46 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by wzgy0920, Today, 09:53 PM
        0 responses
        9 views
        0 likes
        Last Post wzgy0920  
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:25 PM
        0 responses
        10 views
        0 likes
        Last Post Rapine Heihei  
        Working...
        X