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 gravdigaz6, Today, 11:40 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by MarianApalaghiei, Today, 10:49 PM
        3 responses
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by XXtrader, Today, 11:30 PM
        0 responses
        4 views
        0 likes
        Last Post XXtrader  
        Started by love2code2trade, Yesterday, 01:45 PM
        4 responses
        28 views
        0 likes
        Last Post love2code2trade  
        Started by funk10101, Today, 09:43 PM
        0 responses
        9 views
        0 likes
        Last Post funk10101  
        Working...
        X