Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

calling a web api from JS and displaying signals or info on chart

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

    calling a web api from JS and displaying signals or info on chart

    Very much looking forwards to this web lot... was doing js in 1995 ;-) and yes its come a long way since.
    it should be vastly easy indeed with js today to call a webapi and then paint on the chart... news signals data etc
    just throwing this out there - fetch would allow this...

    let response = await fetch(url);



    any limitations or rules as to what we can use in JS etc...?

    Last edited by MicroTrends; 03-15-2023, 12:10 PM.
    MicroTrends
    NinjaTrader Ecosystem Vendor - micro-trends.co.uk

    #2
    I have a use case to do something similar, but with WebSockets. I would ask that this type of usage not be restricted and that we be able to use external libraries (.js files we load from another website) and make RESTful API calls (like the fetch mentioned here) and WebSocket connections. We need this flexibility to be able to deliver high-quality services.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Originally posted by QuantKey_Bruce View Post
      I have a use case to do something similar, but with WebSockets. I would ask that this type of usage not be restricted and that we be able to use external libraries (.js files we load from another website) and make RESTful API calls (like the fetch mentioned here) and WebSocket connections. We need this flexibility to be able to deliver high-quality services.
      that would be smashing indeed :-) but would this be a risk to the stability of the platform - in the wrong hands might be an issue
      must need a compliance phase i guess to approve

      MicroTrends
      NinjaTrader Ecosystem Vendor - micro-trends.co.uk

      Comment


        #4
        The JavaScript all runs locally not on their server, so it cannot risk the stability beyond the local browser - no different than how a badly written NinjaScript indicator/strategy/add-on can risk the stability of NinjaTrader Desktop. It's 100% the same situation.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment


          #5
          Originally posted by QuantKey_Bruce View Post
          The JavaScript all runs locally not on their server, so it cannot risk the stability beyond the local browser - no different than how a badly written NinjaScript indicator/strategy/add-on can risk the stability of NinjaTrader Desktop. It's 100% the same situation.
          yes! great point!!!! this could be really awesome!!!
          MicroTrends
          NinjaTrader Ecosystem Vendor - micro-trends.co.uk

          Comment


            #6
            QuantKey_Bruce do you know if it's possible to fetch outside data in Tradovate?

            Comment


              #7
              Hello MicroTrends,

              Thanks for your post.

              We are really excited to be able to offer custom coding on our Web platform soon!

              Unfortunately, we do not have these resources and documentation completed quite yet so I cannot say for certain what the limitations might be.

              Please let me know if I may be of any further assistance.
              <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


                #8
                Originally posted by backtester831 View Post
                QuantKey_Bruce do you know if it's possible to fetch outside data in Tradovate?
                There are some issues with CORS (cross-domain requests from JavaScript), but they should be resolvable, especially if you're in control of both ends of the request.

                Other key challenges would include that fetch or XMLHttpRequest is asynchronous - you don't want to hang an indicator calculation while it waits on the web request which may or may not respond reasonably quickly, so you have to develop with that in mind.
                Last edited by QuantKey_Bruce; 03-16-2023, 07:52 AM.
                Bruce DeVault
                QuantKey Trading Vendor Services
                NinjaTrader Ecosystem Vendor - QuantKey

                Comment


                  #9
                  Originally posted by QuantKey_Bruce View Post
                  There are some issues with CORS (cross-domain requests from JavaScript), but they should be resolvable, especially if you're in control of both ends of the request.

                  Other key challenges would include that fetch or XMLHttpRequest is asynchronous - you don't want to hang an indicator calculation while it waits on the web request which may or may not respond reasonably quickly, so you have to develop with that in mind.
                  That's all fine, but are you saying that Tradovate allows external libraries right now, or already includes a library for making an external https call?

                  Comment


                    #10
                    I have not tested external libraries. The XMLHttpRequest appears as if it would have succeeded but for CORS but I have not yet set up a test API endpoint with CORS enabled to check if that is the only problem.

                    Tradovate now forbids calling external DLLs, which they previously permitted.
                    Bruce DeVault
                    QuantKey Trading Vendor Services
                    NinjaTrader Ecosystem Vendor - QuantKey

                    Comment

                    Latest Posts

                    Collapse

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