Jump to content
  • 0

IG Excel Sample Modified to Download Data by Historical Range


Guest WYTrade

Question

Guest WYTrade

Hi! Anyone got any tools / ideas on how to modify IG's excel sample to download data by historical range? Currently the excel sample is only able to download by a set number of data points from the latest date. 

I am not very good with VBA, I tried (but it didn't work) to modify the VBA code in the excel sample:

 

For Public Function ("price") in IGApiRestClient:

From: 

Public Function prices(epic As String, resolution As String, numPoints As String) As Collection

    Call oXMLHTTP.Open("GET", IG_API_HOST + "/prices/" + epic + "/" + resolution + "/" + numPoints, False)

To: 

Public Function prices(epic As String, resolution As String, startDate As String, endDate As String) As Collection

    Call oXMLHTTP.Open("GET", IG_API_HOST + "/prices/" + epic + "/" + resolution + "/" + startDate + "/" + endDate, False)

 

For Private Sub priceHistoryButton_Click() in Sheet1:

From:

Set prices = restClient.prices(epicTextBox.value, priceResolutionComboBox.value, numPointsTextBox.value)

To:

Set prices = restClient.prices(epicTextBox.value, priceResolutionComboBox.value, Range("K2").value, Range("K3").value)

 

I tried to key in the dates (in "YYYY-MM-DD HH:MM:SS") in cells K2 & K3 but it doesn't work. Any ideas/help on how to make it work?

Link to comment

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • image.png

  • Posts

    • Ready to experience the power of the latest Telegram Signal Bot? Explore the exchange BetterTest Event and witness the potential for yourself! Experience firsthand the accuracy and efficiency of a unique signal bot in real-time trading scenarios. Test its capabilities and see how it can enhance your trading experience. Why Participate? - Refine User Experience: Help us improve the product by providing valuable feedback. - Enhance Audience Reach: Leverage your dedicated audience channels more effectively. - Community Management: Intuitively manage your communities and improve follower quality. - Top Channel Management Tool: Collaborate with us to create an industry-leading platform. Will you miss this opportunity to engage with exchange cutting-edge technology and take your trading to the next level?
    • Memecoins are super volatile, but if you're holding from here, keep an SL at break even & chill!
    • Grabbed a little bag, let's see how it goes!
×
×
  • Create New...
us