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

Cretate person error message

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

    Cretate person error message

    Hi,

    1)
    I tried to search the forum, but I could not find anything.
    I have three parameters that can be entered by the user: A, B and C. They must be A <B <C. If the user enters wrong values I want one of two things:
    - that in the strategy analyzer does not accept values other than A <B <C, or
    - that an "Error" banner opens, which warns the user that he made a mistake

    2)
    How can I display an error banner that blocks the strategy?

    Thanks Alberto

    #2
    Hello Apo84,

    Thank you for your note.

    It would be simplest to put logic at the beginning of OnBarUpdate that checks the values of the three inputs against each other, and if A is greater than B or C, or if B is greater than C or so on, then display a message and return out of OnBarUpdate.

    I'm attaching a simple example strategy that demonstrates. It will place orders only if the parameters are in ascending order of value. If they are not, it will display a message telling the user to check the parameters using Draw.TextFixed.

    Please let us know if we may be of further assistance to you.
    Attached Files
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thanks, for the answer.

      I want to display an error banner that blocking the strategy. Because I want it to appear on a banner.
      Thanks Alberto

      Comment


        #4
        I need to know how to create warning or error popups etc ...
        I attach an example
        Attached Files

        Comment


          #5
          Hello Apo84,

          Thank you for your reply.

          That's going to be more complicated than simply printing a message telling the user to check the parameters.

          In general there is not a specific NinjaScript command for a popup, this would just be a C# general item. Also we generally don't suggest using popups as this blocks you from clicking the user interface until you click OK on the message, if that is the action you are seeking you could utilize this information: https://www.dotnetperls.com/messagebox-show

          You could populate the string with any information you wanted such as telling the user to fix the parameters.

          Please let us know if we may be of further assistance to you.
          Kate W.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by SnailHorn, Today, 08:38 AM
          2 responses
          3 views
          0 likes
          Last Post SnailHorn  
          Started by giulyko00, Today, 11:49 AM
          0 responses
          2 views
          0 likes
          Last Post giulyko00  
          Started by Skifree, Yesterday, 11:38 PM
          1 response
          15 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by Mathias79, Today, 10:38 AM
          6 responses
          21 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by eladlevi, Today, 11:02 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X