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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        164 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        85 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        126 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        207 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        185 views
        0 likes
        Last Post CarlTrading  
        Working...
        X