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

Indicator syntax

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

    Indicator syntax

    I need to know the syntax is pass a variable from one chart to another, so I can incorporate it into my indicator.

    Thanks

    #2
    Thank you for your question, .

    I am taking this to mean that you have indicators open in multiple charts and would like to pass messages between them. If this is the case, I am including a publicly available link from the MSDN C# documentation which will guide you toward putting together a global scope file in NT8.

    The C# namespace alias qualifier `::` is used to access a member of an aliased namespace. The `::` operator is often used with the `global` alias, an alias for the global namespace


    If on the other hand you would like to duplicate an indicator in one chart into another chart, you can right-click on the chart tab at the bottom and select "Duplicate in new window" or "Duplicate in new chart"

    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Thanks a lot in getting oriented in this Jessica, I already manage to record global variables in a chart, I am trying to generate the code to be able to read it from another.

      Alejandro

      Comment


        #4
        I have not been able to access the Hashtable from the chart that receives the information, I use the statement "colAlias :: Hashtable test = new colAlias :: Hashtable ();"

        I think when I use the "new" sentence, I create it again and delete the previous content


        Thanks for your help, regards, Alejandro
        Pd: sorry for my writing in English ...

        Comment


          #5
          I have noticed you are using syntax common to other languages such as C++. In C#, the hash table object is known as a Dictionary and is publicly documented here.



          I have included an example where two indicators pass messages back and forth. Please let us know if there are any other ways we can help.
          Attached Files
          Last edited by NinjaTrader_JessicaP; 05-09-2017, 07:10 AM.
          Jessica P.NinjaTrader Customer Service

          Comment


            #6
            Thanks for your reply Jessica, I can not compile the example you sent me, apparently I'm missing Dataannotations, Tasks, Input, Media, Tools, Floatingpoint, which are defined in declarations, I'm using ninja trader
            7 .0.1000.34, I have to load something else ?.

            Regards, Alejandro

            Comment


              #7
              Thank you for this information Alejandro. If you are in NinjaTrader 7, you will not be able to use those samples directly, as they are designed for NinjaTrader 8. However the concepts illustrated will transfer over to NinjaTrader 7. I am happy to answer any questions about the contents. Code samples we provide are for educational purposes, and are not intended for live trading, and are not guaranteed to accomplish any user goal or to be maintained. For convenience, these are the key parts to each file.

              From A :
              Code:
              [FONT=Courier New]
                      private static Object InUse = new Object();
                      public static string Reply(string msg)
                      {
                          string output = msg;
                          lock(InUse)
                          {
                              output += " jumps over the lazy dog";
                          }
                          return output;
                      }[/FONT]
              From B:
              Code:
              [FONT=Courier New]
                      protected override void OnBarUpdate()
                      {
                          Print(Indicators.Example1705514A.Reply("The quick brown fox"));
                      }[/FONT]
              Last edited by NinjaTrader_JessicaP; 05-09-2017, 10:28 AM.
              Jessica P.NinjaTrader Customer Service

              Comment


                #8
                Hi Jessica, thank you very much for all your help, I already achieved my goal, I use global variables to pass information between charts.

                It also proves the statements that I send to pass information between indicators and I worked well.

                Regards, Alejandro R. Troelsen

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by cmtjoancolmenero, Yesterday, 03:58 PM
                8 responses
                31 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by helpwanted, Today, 03:06 AM
                2 responses
                21 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by DayTradingDEMON, Today, 09:28 AM
                0 responses
                9 views
                0 likes
                Last Post DayTradingDEMON  
                Started by navyguy06, Today, 09:28 AM
                0 responses
                2 views
                0 likes
                Last Post navyguy06  
                Started by rjbtrade1, 11-30-2023, 04:38 PM
                2 responses
                77 views
                0 likes
                Last Post DavidHP
                by DavidHP
                 
                Working...
                X