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 AaronKoRn, Today, 09:49 PM
            0 responses
            6 views
            0 likes
            Last Post AaronKoRn  
            Started by carnitron, Today, 08:42 PM
            0 responses
            9 views
            0 likes
            Last Post carnitron  
            Started by strategist007, Today, 07:51 PM
            0 responses
            10 views
            0 likes
            Last Post strategist007  
            Started by StockTrader88, 03-06-2021, 08:58 AM
            44 responses
            3,976 views
            3 likes
            Last Post jhudas88  
            Started by rbeckmann05, Today, 06:48 PM
            0 responses
            9 views
            0 likes
            Last Post rbeckmann05  
            Working...
            X