Tag Archives: M

Steel and Mining #M and a at its lowest since 2003

Steel and Mining and a at its lowest since 2003

[igp-video src=”https://quantlabs.net/blog/wp-content/uploads/2016/02/Steel-and-Mining-M-and-a-at-its-lowest-since-2003.mp4″ poster=”https://quantlabs.net/blog/wp-content/uploads/2016/02/Steel-and-Mining-M-and-a-at-its-lowest-since-2003.jpg” size=”large”]
Steel and Mining #M and a at its lowest since 2003

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Steps from Mupad to custom Matlab M function

Steps from Mupad to custom Matlab M function

Here are the steps involved to create an M function from a Mupad session:

(This uses calculating the basis used in futures trading of Cash Price – Future Price)

http://www.mathworks.com/help/symbolic/create-matlab-functions-from-mupad-expressions.html

>> notebook_handle = mupad;
>> basis = getVar(notebook_handle,’basis’)    <–note: do keep Mupad open in order for this to work!!

basis =

FC – FP

>> h = matlabFunction(S)
Undefined function or variable ‘S’.

>> h = matlabFunction(basis)

h =

@(FC,FP)FC-FP

>> basis = matlabFunction(basis,’file’, ‘basis.m’);

Here is the resulting M function basis.m:

 

function basis = basis(FC,FP)
%BASIS
% BASIS = BASIS(FC,FP)

% This function was generated by the Symbolic Math Toolbox version 6.2.
% 26-Jul-2015 21:13:44

basis = FC-FP;

Join my FREE newsletter as I apply these tools to my automated algo trading 

 

 

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

How to convert Mupad function to Matlab M function within Mupad notebook

How to convert Mupad function to Matlab M function within Mupad notebook

This has been updated it looks like for Matlab 2014!

From within Mupad Notebook:
fprint(Unquoted, Text, “cartesian.m”, generate::MATLAB(S)):

http://www.mathworks.com/help/symbolic/create-matlab-functions-from-mupad-expressions.html
Join my FREE newsletter to learn more Matlab tips

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Deutsche Bank Forex Quant Trading Strategy steps: Matlab Mupad algo expressions to Simulink block or M function

Deutsche Bank Forex Quant Trading Strategy steps: Matlab Mupad algo expressions to Simulink block or M function

This DB strategy has been abandonded due to complexity! Visit here for similar idea

https://quantlabs.net/blog/2014/05/research-paper-algo-for-call-or-put-options-to-matlab-mupad-converted-to-clean-c-or-c-demo-intro/

This will be the first step to convert this  Deutsche Bank Forex Strategy from:

http://stats.lse.ac.uk/kalogeropoulos/LD_1103.pdf

Follow instruction how to move the symbolic expression from Mupad to:

Matlab M function:

http://www.mathworks.com/help/symbolic/create-matlab-functions-from-mupad-expressions.html

Simulink block:

http://www.mathworks.com/help/symbolic/create-matlab-function-blocks-from-mupad-expressions.html

A video demo below for all this

Join my FREE new sletter to leearn if we implement this

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

I could not get my DotNet CSharp application to connect to Matlab 2014a Production Server M Script

I could not get my DotNet CSharp application to connect to Matlab 2014a Production Server M Script

This is easily the most powerful feature in the entire Matlab ecoystem.

I am now using Matlab 2014a.

I failed to get my C# application to connect to a built CTF Matlab M function scrip. This was build by the Production Server compiler which was successful.  I was able to start the MPS (Matlab Production Server) with a proper status showing the license as ‘checked out’ meaning it is successfully started. Everything has been correctly instructed at localhost and port 9910. My browser can not find localhost:9910 or even the correctly deployed magic project at localhost:9910. This is why my C# client is not able connect. I am not sure how much further to proceed as it seems dead in the water.

Join my FREE newsletter to see if we successfully get this running

 

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Here are some limited examples of market inefficiency with Matlab M script source code

Here are some limited examples of market inefficiency with Matlab M script source code

There are some limited examples of market inefficiency with Matlab M script source code:

https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=15&cad=rja&uact=8&ved=0CEEQFjAEOAo&url=http%3A%2F%2Fwww.centerforpbbefr.rutgers.edu%2FJan11-2008%2520papers%2F7-2.doc&ei=PzZVU_-mJKyA2QWU4YCIDA&usg=AFQjCNF0b1YXvZ76jD4YJFx9GurGNaEEJg&bvm=bv.65177938,d.b2I

http://www.mathworks.com/matlabcentral/fileexchange/9264-weak-form-market-efficiency-tests <– best example but still focus on cointegration with equity against a future (this seems to be the only valid arbitrage strategy unless you want a specific mutual fund for this) JUST functions with no test client code

http://erasmus-mundus.univ-paris1.fr/fichiers_etudiants/6267_dissertation.pdf

Do Dark Pools Harm Price Discovery? http://www.mit.edu/~zhuh/Zhu.html <– no practical for trading but useful for those who want to know

Join my FREE newsletter to see if we implement any of these trading ideas

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

FREE Matlab webinars will be useful for application deployment from M scripts and how to extend to C or C++?

FREE Matlab webinars  will be useful for application deployment from M scripts and how to extend to C or C++?

Join my FREE newsletter to see if you want to learn more about Matlab and trading 

MATLAB and Simulink Webinars for Academia

MathWorks
Join us online to learn more about MATLAB and Simulink. Each live webinar is free and features application demonstrations followed by a Q&A session with a MathWorks Engineer.
Course Image_1 Application Deployment with MATLAB
Friday, April 18
9:00 a.m. or 2:00 p.m. EST
2:00 p.m. or 7:00 p.m. GMT

Learn how to deploy MATLAB applications and components.
>>Sign Up
Course Image_2 PID Control Made Easy
Tuesday, April 22
9:00 a.m. or 2:00 p.m. EST
2:00 p.m. or 7:00 p.m. GMT

The webinar will start with a quick theory primer on PID control. MathWorks engineers will then introduce a simple and straightforward way to quickly design, tune, and implement PID controllers.
>>Sign Up
Course Image_3 MATLAB to C Made Easy
Tuesday, May 22
9:00 a.m. or 2:00 p.m. EST
2:00 p.m. or 7:00 p.m. GMT

In this webinar we demonstrate the workflow for generating readable and portable C code from your MATLAB algorithms using MATLAB Coder.
>>Sign Up

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Youtube video demo overview of Matlab Simulink and Stateflow Model with Custom M function

Youtube video demo overview of Matlab Simulink and Stateflow Model with Custom M function

http://www.mathworks.com/help/stateflow/examples/server-queueing-system.html

Learn more about these tools for trading through my FREE newsletter 

 

 

 

 

 

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Matlab Simulink and Stateflow gotchas while running simulation with code generation with custom M functions

Matlab Simulink and Stateflow gotchas while running simulation with code generation with M functions

While in Simulink and Stateflow, if you use Matlab M functions it appears all local function variables need to be defined in the workspace. While running the simulation you can get errors like:

    Undefined function or variable ‘m’. The first assignment to a local variable determines its class.

Function ‘rsi’ (#89.382.383), line 17, column 2:

“m”

Launch diagnostic report.
While in SImulink and Stateflow, if you use Matlab M functions it appears all local function variables need to be defined in the workspace. This is needced 
for the Coder during the code generation process. I am sure there is a smarter way but I will dig into it in the near future. 
Hope this helps somewhat so far. 

Also, when using Stateflow transitions for Matlab M functions, you need to define the M function on the transition as explained here:
http://www.mathworks.com/help/stateflow/ug/example-of-a-matlab-function-in-a-stateflow-chart.html

I will post a full set of files with C++ code generated file. Want to know when that happens, join my FREE newsletter 

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!