Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Example - call to thrid party service before indicator starts

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

    Example - call to thrid party service before indicator starts

    Is there a example of blocking an indicator from loading/starting until it makes a call to a thirdparty server (for data) and once successful continues?

    #2
    Hello WHICKED,

    Thank you for your post.

    Please see the LoadNews method in the jtEconNews2a indicator located in our NinjaTrader Ecosystem User App Share center for an example of how this may be accomplished.

    jtEconNews2a - https://ninjatraderecosystem.com/use.../jteconnews2a/

    Please let us know if we may assist further.

    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      How does this 'block' the indicator from progressing forward?

      Comment


        #4
        Hello WHICKED,

        Thank you for your note.

        While this type of development is outside the scope of our support, the method upload is synchronous meaning it has to execute to completion before the lines following it can run. You could research the various ways that C# can interact with web services, that may include either synchronous or asynchronous depending on what is being used. NinajTrader does not use async so anything that already blocks will need to execute.

        Please note that this blocks the thread. It does not prevent the indicators use if it fails.

        Please let us know if you have any other questions.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Followup question. Is there a method within NT8 that allows a background 'service' that is hidden from the indicator list that can be referenced by indicators to load the data once it is available? Single point of information instead of having to load it from each indicator that needs it.

          Comment


            #6
            Hello WHICKED,

            Thank you for your inquiry.

            C# offers different design patterns that would allow sharing data like you are asking, however, that is going to be outside of what our support can provide education for. The topic I am referring to is static.

            MSDN - https://docs.microsoft.com/en-us/dot...eywords/static

            You can learn about using static on MSND in the publicly available link above. It is a confusing topic without learning about it first so please ensure you understand what this concept is before trying to implement it anywhere in NinjaScript.

            This may be accomplished using a static public property in an Addon. AddOns run in the background and hit State.Active when they are ready. You could do a web request in State.Active and then store the result to a static public property. Then, anywhere you want that data you would call MyAddonClass.StaticPropertyName to get its value.

            You could also use the AddOn sample if you wanted a UI to control that requesting or make an actual tool. Please see the help guide link below for more information.

            AddOn Development - https://ninjatrader.com/support/help...t_overview.htm

            Let us know if we may assist further.
            <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            563 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            329 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            547 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            547 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X