Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple data input form

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

    Simple data input form

    Hi,
    I have an indicator that create a button on the toolbar of chart panel. I have already the method on click().
    I want that when i press the button, ninjatrader show me a simple pop-up/form with a textbox and a datetimepicker and a button, so i can insert data and store it into variables when i click "OK" button on this last form.

    Please, I have no idea how to do that, can you provide a generic sample?

    Thanks

    #2
    Hello Davide999,

    Thanks for your post.

    My colleague Chelsea has posted an example script you could view called SetIndicatorValueFromAddOnWindowExample_NT8 on the forum thread linked below that demonstrates returning information from an addon window to an indicator.

    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hi,
      I tried; all is fine and works but when i click OK button on the WPF forms to terminate the work, i obtain this error: " Error - calling thread cannot access this object because a different thread owns it"

      Can you check my code and let me know? I tried multiple ways reading on this forum but i can't able to see where is the calling error (i'm using a dispatcher.invoke())

      Thanks
      Attached Files

      Comment


        #4
        Hello Davide999,

        To confirm, are you getting this error with the SetIndicatorValueFromAddOnWindowExample?

        In your script, I am not seeing a dispatcher used to access the ChartControl in the RetreiveValues() method.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello,
          Yes; so everything is working but when i click OK on the windows form to update a txt files, i obtain this error. txt files is updated but on ninjatrader i get this error a few seconds before that the form is closing because the function is endend at this point.
          How can i use a dipatcher to access the chart control?

          thanks

          Comment


            #6
            Hello Davide999,

            Below is a link to the help guide with sample code.


            Code:
            ChartControl.Dispatcher.InvokeAsync(() =>
            {
            NinjaTrader.Gui.Tools.NTMessageBoxSimple.Show(Window.GetWindow(ChartControl.OwnerChart as DependencyObject),
            "Date succesfully updated into file " + path, "UpdateStartDeltaDate", MessageBoxButton.OK, MessageBoxImage.Information);​
            });
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            639 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            366 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            107 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            569 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            572 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X