Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Put alert price into alert message

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

    Put alert price into alert message

    Hi,

    How do I insert the price at which the alert was made, into the alert message?

    Code:
    Alert("namealert", Priority.High, "alert message and price", @"C:\Program Files\NinjaTrader 7\sounds\alert.wav", 1, Color.Red, Color.White);

    #2
    Hi ScottieDog,

    Thank you for your post.

    You would want to use this string line for the Alert -
    "Alert Message and price: " + Close[0]
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      OK, great. That´s adding the price alongside the alert message correctly now. Thanks.

      If I wanted to put a space in between the alert message and the price, how do I add a space or two?

      At the moment it is plotting as "alertmessageprice" with no space, I want it to plot with a space before the price.. ie "alertmessage price"

      How do I add a few spaces ?

      Comment


        #4
        ScottieDog,

        The String text will use the number of spaces you add into.
        Example, my last post show having a space from the colon to the end of the string or the quotation mark.
        "Alert Message and price: " + Close[0]

        Additionally, you can do it this method as well -
        "Alert Message and price:" + " " + Close[0]
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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