How to update the price of an option every minute with real time data?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Shivam Lahoti
2024년 2월 18일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!