Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Update Method ...problem

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

    Update Method ...problem

    i call indicator from another indicator :

    Code:
     public class AutoGannLineLuca1 : Indicator
    .....
     if (Prova(3).cambioMt)
     {
    //instruction...
    }
    In my indicator Prova i set this :

    public bool CambioMt
    {
    get
    {
    Update();
    return cambioMt;
    }
    in chart i've apply only the first indicator (AutoGannLineLuca1)
    but i don't see to execute Update of Prova..

    what is the error?

    #2
    Thank you for your question turbofib. The most likely cause of this is that you are using cambioMt instead of CambioMt. C# is a case sensitive language, and cambioMt and CambioMt are different variables. In the former case, you are likely accessing some part of your Prova indicator's memory directly, bypassing your getter. Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      another question about Update()

      if in my code


      Class Pippo:indicator
      {
      OnBarUpdate()
      { ....
      var f= CambioMt();
      ......
      }

      public bool CambioMt
      {
      get
      {
      Update();
      return cambioMt;
      }


      }
      if i call CambioMt in the OnBarUpdate of the same code...

      It run 2 times OnBarUpdate or 1 time?

      Comment


        #4
        If Update calls OnBarUpdate, this would result in an infinite loop and your strategy would crash. Otherwise, if it does not, you will just run OnBarUpdate one time.
        Jessica P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        571 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        330 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        548 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        549 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X