How to Auto Refresh AlphaVantage Technical Indicator?

einstein1

New Member
Joined
Dec 16, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
hi

im trying out alphavantage excel addin, to retrieve and refresh technical indicator every 5 seconds.

example formula is cell D1
alphavantage sample.xlsm
D
1EMA
Sheet1
Cell Formulas
RangeFormula
D1:D627D1=INDEX(AlphaVantage.TechnicalIndicator("AAPL","EMA","60min",A6:B7),,2)
Dynamic array formulas.



i have tried running vba code such as
VBA Code:
Sub Calculate_Range()  
   Range("G3").Calculate  
   Application.OnTime DateAdd("s", 5, Now), "Calculate_Range"  
 End Sub

and also
VBA Code:
Public RefreshTime As Double
Public Const Seconds = 30 'Input Refresh Interval in seconds


Sub StartRefreshLoop()

'User Message indicating loop is beginning
  MsgBox "Refreshes will begin to occur at " & _
    "the designated interval of " & Seconds & " seconds"

'Call the first Refresh
  Call StartRefreshes

End Sub


Sub StartRefreshes()

'Calculate Next Refresh Time
  RefreshTime = Now + TimeSerial(0, 0, Seconds)

'Trigger a Refresh with OnTime function
  Application.OnTime _
    EarliestTime:=RefreshTime, _
    Procedure:="RefreshConnections", _
    Schedule:=True
 
End Sub


Sub RefreshConnections()

'Refresh Data Connections
  ThisWorkbook.RefreshAll

'Start Timer Over Again
  Call StartRefreshes

End Sub


Sub EndRefreshLoop()

'On Error Resume Next
  Application.OnTime _
    EarliestTime:=RefreshTime, _
    Procedure:="RefreshConnections", _
    Schedule:=False

'User Message indicating loop has ended
  MsgBox "Refreshes are no longer occurring"

End Sub

but it doesnt seem to refresh.
it works on cells thats uses formula rand()

i have installed the xl2bb addon, but it's greyout in my windows. not sure why as well.

i have contacted support, but they say vba should work to refresh the technical indicator data.

any help please?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
the first vba code should be referencing cell D1 instead of G3, but it still doesnt work
 
Upvote 0

Forum statistics

Threads
1,214,854
Messages
6,121,941
Members
449,056
Latest member
denissimo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top