MATLAB functions with trading systems

1 visualizzazione (ultimi 30 giorni)
S Tajik
S Tajik il 7 Feb 2011
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.

Risposte (1)

Walter Roberson
Walter Roberson il 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.
  1 Commento
S Tajik
S Tajik il 8 Feb 2011
thanks for the reply. good help.
My original function is called using addlistner handler. It seems the timer object is the only way. any more info would be much appreciated.
cheers

Accedi per commentare.

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by