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

Share to Twitter Alert from Strategy

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

    Share to Twitter Alert from Strategy

    when sharing to twitter through Strategy trigger of conditions, in setting up message, what message would include

    Instrument
    Current Price at time of share
    Time of alert

    Thanks

    #2
    Hello DTSSTS,
    Thanks for your post.

    You can use Share() to send a message or post a screenshot to your Twitter account. The following snippet would post "your message here" to the configured Twitter account:
    Code:
    Share("Twitter", "your message here");
    https://ninjatrader.com/support/help...-us/?share.htm


    In regards to the items you want to include in the message, I have included their help guide links below:

    You can use the Instrument object to get instrument related information:
    Instrument-- https://ninjatrader.com/support/help...instrument.htm

    You can use Close[0] to get the current price:
    Current Price at time of share-- https://ninjatrader.com/support/help...-us/?close.htm

    You can use Time[0] to get the current bar timestamp:
    Time of alert-- https://ninjatrader.com/support/help...eries_time.htm
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      this is what i got




      Comment


        #4
        Instrument.GetInstrument(string instrumentName)

        i just used

        Instrument.GetInstrument

        Comment


          #5
          DTSSTS,

          Using GetInstrument without an input would be incorrect.

          What are you expecting the output for GetInstrument to be?
          Josh G.NinjaTrader Customer Service

          Comment


            #6
            the input is the strategy that triggered the share

            Comment


              #7
              DTSSTS,

              the input is the strategy that triggered the share
              I would like to know what output you expect, not the input.

              I also still do not understand why you are using GetInstrument without an input and what you expect that to accomplish. Are you trying to get the name of the current instrument?

              Josh G.NinjaTrader Customer Service

              Comment


                #8
                yes i want the message to say



                ADBE LongBounceVL Watch 182.45 <============ price of the last close bar that sent the share message

                Comment


                  #9
                  looking here for help

                  You can use the Instrument object to get instrument related information:
                  Instrument-- https://ninjatrader.com/support/help...instrument.htm

                  Comment


                    #10
                    DTSSTS,

                    It looks like your string input is likely not formatted properly. Can you show some code?

                    For example, the following would share the current instrument name and the current close price to twitter.
                    Code:
                    Share("Twitter", "The instrument name is "+Instrument.FullName+" and the current price is "+Close[0]);
                    Josh G.NinjaTrader Customer Service

                    Comment


                      #11


                      no body mention the + sign

                      Comment


                        #12

                        +Instrument.FullName+ the close only has " + " in front

                        Comment


                          #13
                          so is this what i need


                          Comment


                            #14
                            DTSSTS,

                            no body mention the + sign
                            This is a general C# concept not exclusive to NinjaTrader. You can read more about string concatenation at the following public msdn link: https://docs.microsoft.com/en-us/dot...ltiple-strings

                            Using the Strategy Builder is going to be another matter entirely as it will automatically concatenate the separate strings for you. When you want to create a string that contains the instrument name or the close price(or any other object) you need to click where it says "set", and then navigate the folders to find the object you want to use. You will not be able to simply enter in the information I have given you as a string.

                            Additionally, please be sure to include the fact you are working in the Strategy Builder to avoid confusion going forward.
                            Josh G.NinjaTrader Customer Service

                            Comment


                              #15
                              exactly how do i "SET" Instrument.FullName

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by adeelshahzad, Today, 03:54 AM
                              5 responses
                              32 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by stafe, 04-15-2024, 08:34 PM
                              7 responses
                              32 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by merzo, 06-25-2023, 02:19 AM
                              10 responses
                              823 views
                              1 like
                              Last Post NinjaTrader_ChristopherJ  
                              Started by frankthearm, Today, 09:08 AM
                              5 responses
                              21 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by jeronymite, 04-12-2024, 04:26 PM
                              3 responses
                              43 views
                              0 likes
                              Last Post jeronymite  
                              Working...
                              X