• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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
      https://gyazo.com/22083c43066f82c55b3a6f7e7516e9b3

      https://gyazo.com/6518d0882cb00d3aa09e163ee7f9774e

      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

                https://gyazo.com/6518d0882cb00d3aa09e163ee7f9774e

                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
                      https://gyazo.com/3d04802c0d31028ca8afccf9fe3ac442

                      no body mention the + sign

                      Comment


                        #12

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

                        Comment


                          #13
                          so is this what i need

                          https://gyazo.com/f9d9ca969e4d126a4901e859ab7c0cbe

                          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 marcus2300, Today, 02:25 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post marcus2300  
                              Started by drpapp, 01-24-2019, 06:57 AM
                              5 responses
                              68 views
                              0 likes
                              Last Post pjsmith
                              by pjsmith
                               
                              Started by plydcv, Today, 12:40 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post plydcv
                              by plydcv
                               
                              Started by Sh00tHerMcGavin, Yesterday, 07:39 PM
                              0 responses
                              4 views
                              0 likes
                              Last Post Sh00tHerMcGavin  
                              Started by Mberg, Yesterday, 05:13 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post Mberg
                              by Mberg
                               
                              Working...
                              X