How to update the price of an option every minute with real time data?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I am using the datafeed toolbox, connecting it to money.net.
I get the real time price of a stock, and using the binomial trees I get the price.
How can I update the price of the option every minute? because it takes 1 or 2 seconds to run the binomial tree with 100000 steps,so it is difficult to get an instantaneous update.
Thanks in advance!
0 comentarios
Respuestas (1)
Shivam Lahoti
el 18 de Feb. de 2024
Hi GIUSEPPE,
I understand that you want to manage the minute-by-minute updates of option prices in MATLAB while accounting for the 1 to 2 seconds needed for binomial tree calculations. For this, you can indeed implement a timer mechanism. Utilize MATLAB's timer, start, and stop functions to orchestrate a script that triggers a custom function at the onset of each minute. This function would obtain the latest stock price from Money.net. Following this, it would execute the custom binomial tree model.
After the calculation, the script should proceed to update the display or storage based on your setup, which could involve refreshing a GUI element or writing the new data to a file. Set the timer's Period to 60 seconds to achieve consistent execution every minute and adjust the StartDelay property to synchronize the first execution with the beginning of the next minute.
To learn more about the timer function, please refer to the following documentation:
I hope this was helpful.
Regards,
Shivam.
0 comentarios
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!