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

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 RDTrader16, Today, 10:19 PM
        0 responses
        3 views
        0 likes
        Last Post RDTrader16  
        Started by gemify, 03-08-2023, 08:02 AM
        9 responses
        148 views
        0 likes
        Last Post culpepper  
        Started by elirion, Today, 10:03 PM
        0 responses
        1 view
        0 likes
        Last Post elirion
        by elirion
         
        Started by RaddiFX, Today, 09:55 PM
        0 responses
        6 views
        0 likes
        Last Post RaddiFX
        by RaddiFX
         
        Started by Trader146, 03-29-2024, 01:22 PM
        4 responses
        25 views
        0 likes
        Last Post Trader146  
        Working...
        X