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 Mestor, 03-10-2023, 01:50 AM
            16 responses
            388 views
            0 likes
            Last Post z.franck  
            Started by rtwave, 04-12-2024, 09:30 AM
            4 responses
            31 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Started by yertle, Yesterday, 08:38 AM
            7 responses
            29 views
            0 likes
            Last Post yertle
            by yertle
             
            Started by bmartz, 03-12-2024, 06:12 AM
            2 responses
            22 views
            0 likes
            Last Post bmartz
            by bmartz
             
            Started by funk10101, Today, 12:02 AM
            0 responses
            7 views
            0 likes
            Last Post funk10101  
            Working...
            X