Announcement

Collapse
No announcement yet.

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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        119 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        63 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        45 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        82 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X