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

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 junkone, 04-21-2024, 07:17 AM
        9 responses
        67 views
        0 likes
        Last Post jeronymite  
        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
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by wzgy0920, Today, 09:53 PM
        0 responses
        10 views
        0 likes
        Last Post wzgy0920  
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X