Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Are the Reacitve Extensions (Rx) allowed in NT 8

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

    Are the Reacitve Extensions (Rx) allowed in NT 8

    I used Reactive Extensions in NT 7 and am trying to implement them in NT 8. I inserted the code below:


    #region rx
    public static class rx
    {
    static BindingFlags bind = BindingFlags.FlattenHierarchy |
    BindingFlags.IgnoreCase | BindingFlags.Instance |
    BindingFlags.NonPublic |
    BindingFlags.InvokeMethod | BindingFlags.Static |
    BindingFlags.Public;

    public static object call(object parent,string methodName,object[] args)
    {
    MethodInfo metInfo = parent.GetType().GetMethod(methodName,bind);
    return metInfo.Invoke(parent,args);
    }
    }
    #endregion // End rx



    but get a compiler error that "BindingFlags" could not be found.

    I used this Class to allow me to programmatically do mouse clicks on buttons.
    Can this be done in NT 8?

    taddypole...

    #2
    Hello Taddypole,

    The code/types you have shown are part of C# reflection. I am not certain what "Reacitve Extensions" are but you can search online for "C# reflection" if you wanted to know more about using types like BindingFlags or the other items you have shown.

    The error you are getting is because you are missing a using statement for that type. These are not NinjaScript types so NinjaTrader/NinjaScript won't have any information about using that, you would need to refer to C# guides and tutorials for using reflection in C#.

    If you want to programmatically click something in NT8 you would need to do it in a way that is supported by WPF which is the window framework NT8 uses. You can see one example of clicking a UI button in the following link, you would need to find the button first and then use the instance of that button to invoke a click. https://ninjatrader.com/support/foru...11#post1052911

    If the purpose is to click items like a buy or sell button you likely are better off to avoid doing that and instead use the addon framework for placing trades programmatically using the account.



    Comment


      #3
      What I'm trying to do and did in NT 7 is create a button that would allow me to press it when I was near a market condition where I would like to place a trade. The button is now in an "armed" mode waiting for a signal in the market that enters an ATM strategy trade. Once the trade is in place I would than reset the button to be ready to be "armed" again if there was another condition that warranted an add on trade. I would then manage the trade with the normal Chart Trader ATM strategy settings and controls.

      Can I maybe just add a button to the Chart Trader to do this?

      Comment


        #4
        Hello Taddypole,

        Yes you can just add your own button for that purpose. You could use either an indicator or strategy for that. if using an Indicator you would need to reference the Addon section in the help guide and use the Account/atm features from that section. If using a Strategy you would need to reference the ATM methods under the Strategy help guide section.

        Indicator: https://ninjatrader.com/support/help...ount_class.htm


        Strategy:



        For adding buttons you can see the following link which has examples of modifying the chart. Those can work in either a strategy or indicator. https://ninjatrader.com/support/foru...27&postcount=1

        Comment


          #5
          I've switched to "ChartTraderCustomButtonsExample" to build my indicator from.

          I'm trying to create individual buttons instead of using the array example.
          I'm able to create a buttonBuy and place it but am having problems of removing it or disposing it.

          any clues?

          Attached Files

          Comment


            #6
            When I shut down and reloaded everything, I found that everything was worked properly. I do not have multiple buttons now.

            Next I added another button but it appears to overlap the first button. How do I move it to the right?



            Attached Files

            Comment


              #7
              Hello Taddypole,

              To clarify, are you still having a problem disposing the controls or was restarting the solution there?

              To move buttons you would need to use WPF placement using grids. Looking at the script you provided you still have the lowerButtonsGrid and it has columns defined. It looks like you are just missing the code to set what column the button you add to lowerButtonsGrid is in.

              Code:
              Grid.SetColumn(buttonVariable, 2);
              Hello All, Moving forward this will be maintained in the help guide reference samples and no longer maintained on the forum. Creating Chart WPF (UI) Modifications from an Indicator - https://ninjatrader.com/support/help...ui)-modifi.htm (https://ninjatrader.com/support/helpGuides/nt8/creating-chart-wpf-(ui)-modifi.htm) I've


              Please let me know if I can be of additional help.

              Comment


                #8
                Hi Jesse...
                No, it looks like it is disposing the controls correctly.
                And thanks for Grid.SetColumn tip...
                I have it now working...

                regards,
                taddypole...

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                574 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                332 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
                553 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                551 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X