MATLAB functions with trading systems
1 view (last 30 days)
Show older comments
I use MATLAB to build trading systems. Right now I got a function that works in the background and get live market prices. Now I need to process these prices in real time through different functions and produce new output. The problem: When I run any function of m file MATLAB stops running the live market prices function in the background and uses just the last value provided by live market prices function before the m file or new function was executed. I basically need a way to have these few different functions work at the same time.
0 Comments
Answers (1)
Walter Roberson
on 7 Feb 2011
You would need the Parallel Processing Toolkit and you would need to use SMPD. You might need to use labSend or labBroadcast to communicate the prices
Basic Matlab is an event driven environment that allows for interrupts (in some circumstances) but is not multithreaded. It is not designed for running routines simultaneously.
Possibly for your purposes it would be acceptable to fire the update functions at regular intervals using a timer object. Some people would consider this to be "real time" and other people would not.
Whatever mechanism you are using for getting the prices might potentially have callbacks notifying that new data is available. When such routines are used with care, they can update shared information about the prices.
See Also
Categories
Find more on Transaction Cost Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!