HTTP Requests?


I’m trying to implement an indicator that needs to fetch additional data from an API I’ve been working on. The Tradovate javascript environment is setup to explicitly prevent requests to anything outside of a handful of whitelisted domains. I imagine I could probably implement this as a .dll and have that code actually go out and make the request but that feels really heavy handed.

Is there any workaround for this or plans to allow access to external data sources from a custom indicator’s JS code?

So, I got this to work but it’s pretty hacky, I had to make two changes to the electron app.

One is to remove the CSP from the index.html so that I’m able to make HTTP requests to my server. Any chance of at least adding localhost as an option to the default index? I understand the concern about allowing any indicator to make requests to anywhere, but localhost should be reasonably safe enough and allow for developers to easily integrate things.

The second is to bump the ecmaVersion of the Acorn library to 2020. Any chance of having this increased from 5/6? I need to be able to use async/await to fetch data in the init function of my indicator. I might be able to work around this by manually plotting the data instead of letting the app do it for me, but this feels like it should be somewhat safe to change on the Tradovate side?

This works well enough for me to be able to use this, but I’m definitely concerned about maintaining since I’ll have to manually change the electron app any time there’s an upgrade. Any chance of either of the above changes being made?

Hi there,

Thank you for your post - really interesting.

Could you please share a little bit more about your implementation or part of code? Or advise which post or article to start?