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

Use of indicator in strategy

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

    Use of indicator in strategy

    Hello,

    I hope you had a great weekend :-)

    I am facing a very strange situation...

    I have created an indicator.
    I use this indicator to create another indicator
    Basically, I do the following in my new indicator

    private MyIndicator mi1;

    And then I use it

    NewIndicator[0] = mi1[0];

    This works fine...

    But if i try to do the same in a strategy, instiating a my newindicator won t work and i will get a message CS0118 stating blabla is a 'method' but is used like a 'Type'

    The line where it stops is the one where I declare in the properties the new indicator

    private NewIndicator ni1;

    This is actually since in one of the sample (SampleMultiInstrument) provided with the software, you are using 1 RSI and 2 ADX in this exact same way and the compilation is just doing fine.

    could it be because my indicator is calling another indicator ?

    best

    #2
    Hello guilhem,

    NewIndicator doesn't exist in the context you have provided.

    Try:

    mi1 = MyIndicator();

    Print(mi1[0]);
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello guilhem,
      Can you confirm if your new indicator is in default folder or you made a sub folder, if so you need to specify full folder path along with indicator name while initializing. Hope it helps!

      Comment


        #4
        i did a new folder indeed hence my reply to the other post :-)

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rocketman7, Today, 09:41 AM
        5 responses
        16 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by frslvr, 04-11-2024, 07:26 AM
        9 responses
        124 views
        1 like
        Last Post caryc123  
        Started by selu72, Today, 02:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by WHICKED, Today, 02:02 PM
        2 responses
        19 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by f.saeidi, Today, 12:14 PM
        8 responses
        21 views
        0 likes
        Last Post f.saeidi  
        Working...
        X