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 Jon17, Today, 04:33 PM
            0 responses
            1 view
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            4 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            10 views
            0 likes
            Last Post bltdavid  
            Started by alifarahani, Today, 09:40 AM
            6 responses
            40 views
            0 likes
            Last Post alifarahani  
            Started by Waxavi, Today, 02:10 AM
            1 response
            19 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Working...
            X