Hi all,
I am just becoming familiar with MATLAB and Simulink and wanted to ask for advice on which development tools and techniques to use to achive my development task.
My goal is to use MATLAB to design a controller to commmand a cTrader expert advisor. In a nutshell the specification for the MATLAB component comprises
- receive price and volume information from cTrader. Frequency up to about 100Hz.
- receive status information from the trading account.
- analyse the data
- derive state transsitions following statemachine logic
- derive buy and sell decisions
- send commands to cTrader c# interface and verify execution
- inform the user about the state of trading
- test the implemented strategies agains historic data
So what I am am looking for is a real time controller with a user interface running in MATLAB environment receiving and sending data to the c# expert advisor running in cTrader.
My current questions are:
How do I send data like price or status information from c# expert advisor to MATLAB most efficiently? UDP or TCP would be an option to send for example JSON formated datagrams, but maybe there is a better way?
If UDP/TCP is a good solution where do I place the receiver? It could be defined in a MATLAB script or a simulink instrument controll block, but how do I decode the JSON data an feed them in a buffer?
How do I setup Simulink to run as a controller in real time? I am aware of toolboxes like "simulink real-time", "instrument control toolbox", "Guide" is an unknown to me at this time, so I am not familiar which toolbox I need to be able to design a controller for example with stateflow and make a visual user interface to be able to interact. So I would be glad for some advice in which direction to work.
How to store historic data to backtest strategies? Another, not neccessarily real time task, would be to store historic data and check the controller against these to test for performance. Any advice on which database to use and how to efficently feed them to simulink for testruns?
These questions are very diverse. Since I am at the begining of this project directions to best practices would be of great value. Also more detailed solutions for individual problems that I may be able to adapt would help.
Thank you all for you assistance!
Cheers