• 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

Building a URL

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

    Building a URL

    Hi,

    Has anyone made a URL building function that can send the url on bar close or some event.

    Thank

    Tinkerz

    #2
    Tinkerz,

    I am happy to assist you.

    Do you mean some kind of function that would send a message to email, a website, etc? Could you please clarify?

    I look forward to helping you.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      bump

      can some one help Me with this

      Comment


        #4
        Hello sci_fi683,

        Thank you for writing in and welcome to the NinjaTrader Support Forum!

        I am not entirely clear of what is desired.

        Are you wanting to send an email? Are you wanting a web browser to open to navigate to a specified URL after some event in the script occurs?

        Please clarify further.
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          the Latter
          Web browser to open to navigate to a specified URL after some event in the script occurs.
          Also change Variables in the url based on the script event

          Comment


            #6
            Hello sci_fi683,

            You can use the C# method call to System.Diagnostics.Process.Start() to navigate to a web browser once something occurs.

            You'll want to pass a string as the URL.

            As an example:
            Code:
            if (/*some condition*/)
                 System.Diagnostics.Process.Start("http://www.ninjatrader.com");
            You can also create your own method that takes in a string parameter so you can modify the string to whatever URL desired.

            Example:
            Code:
            protected override void OnBarUpdate()
            {
                 if (/*some condition*/)
                      GoToURL("http://www.ninjatrader.com");
            }
            
            void GoToURL(string url)
            {
                 System.Diagnostics.Process.Start(url);
            }
            I've created an additional example below that will modify what website to go to by using a variable:

            Code:
            private string searchEngine = string.Empty;
            
            protected override void OnBarUpdate()
            {
                 if (/*some condition*/)
                      searchEngine = "google";
                 else
                      searchEngine = "yahoo";
            
                 if (/*some other condition*/)
                      GoToURL("http://www." + searchEngine + ".com");
            }
            
            void GoToURL(string url)
            {
                 System.Diagnostics.Process.Start(url);
            }
            Please, let us know if we may be of further assistance.
            Zachary G.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Goolden, Today, 09:51 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by ArmKnuckle, Today, 01:25 AM
            1 response
            25 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by 7robert, Today, 08:26 AM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by 7robert, Today, 08:08 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Jim  
            Started by ttodua, Today, 08:09 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Jim  
            Working...
            X