Announcement

Collapse
No announcement yet.

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

    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.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          80 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          40 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          64 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          66 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          54 views
          0 likes
          Last Post CarlTrading  
          Working...
          X