Tag Archives: HDL

Trading Workflow from Research Paper to Matlab to C C++ or FPGA HDL for ultra lowest latency HFT

Trading Workflow from Research Paper to Matlab to C C++ or FPGA HDL for ultra lowest latency HFT

I have just put up two new postings on how to trade options and futures. There's a definite relationship between these two asset classes but I only focus on options on futures which are non-deliverable.
Here are my two latest postings:

Options pricing and put call parity with intro to arbitrage

Additional options concepts with comparison of futures and options trading

This online course is Free and is a very old-school approach with a fundamental view. It still boggles my mind on how people need to complicate their trading for mediocre results. Do you really want to 
focus exclusively on technical analysis based on past pricing behavior? All these techniques learned can easily be applied into a high-frequency trading setting. Guess what my next phase will be?

Workflow trading idea go from research paper to Matlab to see C++ or FPGA HDL for ultra-lowest latency HFT

I will be starting this process sometime next week. Once finished, this will be my biggest milestone yet. Boy am I excited to release it to the world if it comes together. I will also be focusing on all the 
trading models coming out of this futures and options course which will be implemented using this methodology.
 
Join my Quant Elite membership as this take shape next week. I will be dedicating an entire Meetup around this. Not only that I'll be focusing a video playlist on my YouTube channel on this as well.
Bryan 
PS. If you are living in Toronto please visit our attendance session coming this Monday night.

http://www.meetup.com/quant-finance/events/223943747/
http://www.meetup.com/R-Matlab-Users/events/223943775/

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!

Workflow Quant Algo from Research Paper to Matlab to C C++ or FPGA HDL for ultra lowest latency HFT

Workflow Quant Algo from Research Paper to Matlab to C C++ or FPGA HDL for ultra lowest latency HFT

This is my next phase. This will be my BIGGEST MILESTONE since I started this journey!

I will be starting this process sometime next week. Once finished, this will be my biggest milestone yet. Boy am I excited to release it to the world if it comes together. I will also be focusing on all the trading models coming out of this futures and options course which will be implemented using this methodology.
 
I will be dedicating an entire meet up around this. Not only that I'll be focusing a video playlist on my YouTube channel on this as well.

Join my FREE newsletter to learn when I get this implemented

 

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!

Holy Crap! Simulink FPGA HDL HFT potential Examples

Holy Crap! Simulink FPGA HDL HFT potential Examples

Sometimes you feel like like a kid in a candy factory but these examples are world class as usual

They have been handed off to Mr FPGA as I have no idea what they mean (Soon one day soon)

http://www.mathworks.com/examples/product-group/simulink-code-generation

Join my FREE newsletter to learn more about the potential of these

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!

NEW Workflow Qaunt Algo from Research Paper to Simulink to C C++ or FPGA HDL for ultra lowest latency HFT

NEW Workflow Qaunt Algo from Research Paper to Simulink to C C++ or FPGA HDL for ultra lowest latency HFT

This could be an important workflow to generate your trading idea! Watch the entire video to see the many advantages!

Some of the historical links:

Video 1 segment Mathworks links:

Working with Multiple Input Regions
http://www.mathworks.com/help/symbolic/mupad_ug/evaluate-mathematical-expressions-and-commands.html

Copy MuPAD Variables to the MATLAB Workspace
http://www.mathworks.com/help/symbolic/create-matlab-functions-from-mupad-expressions.html

How to create Simulink block

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

All source is available to my Members of Elite and Premium.

Or join my FREE newsletter to learn how this will be used in my Battle of the Quant Strategies 

MuPad Historical video:

Latest video 

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!

What is is this Matlab typesafe interface vs Builder NE for DotNet CSharp vs Simulink C++ or FPGA HDL quant trading deployment

What is is this Matlab typesafe interface vs Builder NE for DotNet CSharp vs Simulink C++ or FPGA HDL quant trading deployment

On 2014-04-17 10:37
> Bryan,
>
> Have you done any tests using Matlabs TypeSafe interfaces vs their
> standard stuff?
>
> I can without a doubt say that going from .NET -> Matlab over their
> typesafe interface is slow as balls.

 

More info: http://blogs.mathworks.com/loren/2011/06/03/introducing-type-safe-apis-with-builder-ne/

It really has no impact on what I do.  Or at least I hope not but I have not seen any degrade thus far.
I have not really tried this but as you call the standard seems be to decent performance wise. This is a decent result:

This is not the desired end target as we have been looking at FPGA via Simulink. We may generate  from the  Simulink model  to C++ which is pretty efficient. I am also on the hunt for independent frameworks that do not step outside of Matlab code functions (i.e. other toolboxes) which enable me to have a full flexibility for FPGA or C/C++ code generation. Don’t forget I can embed Matlab custom M function into Simulink models.

Using currently the Builder NE or Builder Java is just a quick way to implement a Matlab M script with the REAL TIME market data capture and Interactive Brokers order management execution. I am just more focused on the strategy generation right now.

> So in short.  You haven’t done a performance comparison of equivalent
> functions in a native library compared to calling Matlab and getting a
> result.

How do you mean equivalent functions? An interpreted version written in C# vs calling a Matlab function via a DLL?
This what I can tell you, Matlab offers many advantages in your workflow in developing trading ideas with models or strategies. Generate a DLL via Builder NE is the quickest and easiest way to do this. It is performant based to with so called 100% compatibility with most Matlab toolbox functions. You can also call worker pools for extra parallelization from within the .NET. or C#.
You could also generate C++ code via the Matlab Coder but the C++ is limited plus the Matlab Toolbox support is extremely limited. As mentioned Simulunk seems to be the best but the option via Builder NE for .NET DLLs is the easiest. I hope this helps.

Equivalent I mean run a regression, hypothesis test, etc.. with a
> quality C# library vs call Matlab.

Understanding your situation, there are not a lot of C# .NET libraries for standard math. They are very cumbersome to build and maintain. From my testing, using a library is definitely faster if done in 100% C++ or .NET but don’t forget many libraries are limited. I have done analysis looking at GSL and TA-LIB and even more complex libraries like Boost. The problem is they don’t play nice together so you need to convert from one or another if you hit a some limitation with any of these. Your other option is to develop your own but again, that is a lot of work. I am not sure what your primary goal is here but if you are wanting to move ahead to put a trading idea into a live production platform, you will run into even more headaches.

The nice thing about Matlab is you can rapidly develop your strategy in M script which can be extended in Excel, Java, or .Net. But as you say, you can run into various limitations with performance. The Matlab Coder with C++ generation will not help either due to the code generated is not really helpful in terms of maintenance. This is not a solid option for me. Don’t forget the Matlab Coder does not support all the important trading toolbox functions so that is its major drawback.

The nicest of all options is Simulink. You can visually design your model, control your state of the data through Stateflow, and execute your order in the ‘outflow’ part of the visual Simulink model. As said, it can call custom Matlab M scripts which can include those custom frameworks functions which are self contained. Also with the power of Simulink Coder/HDL Coder, you can deploy this same visual model to C, C++, or your HDL model code of your chosen FPGA all from the same model. As you know, going the FPGA route is the absolute lowest latency if you decide to go true HFT.

The generated C++ code is nice and efficient but there are configuration settings that enable you to encode the Matlab, Stateflow, or Simulink code as comments. This is an awesome way to trace back the Matlab or Simulink pieces within your code. This is why I really like this Simulink option for live trading. One of my members is currently investigating this option.

I am unsure if this is helpful but this is probably the easiest quickest way to market your trading idea. It is also potentially the fastest and lowest level you can generate using something like Matlab.

Outside of painful hand coding, this enables you to generate your idea very fast and probably the highest performance based code you can get. The code generation from Matlab seems pretty efficient as well.

Compared to cryptic non future path languages like R or Python (now even Java), it is a dangerous path to go if you plan to implement some form a ‘quant’ trading business for the future. This is why I like this Matlab Simulink path the best.

> Don’t really agree with those statements on R or Python.  Both work
> fine, all languages have their limitations (including Matlab).
–> I have done numerous analysis on these languages and they are not very beneficial for how fast I bang out trading ideas. I just find them severely limited in a many ways but that could change in the future. As it stands, I care more about trading ideas than splitting hairs over the programming languages. I just use what works for me.

> There seem to be some decent libraries for C# (but they are
> commercial, which is fine).
>
–> There are some but from hard learned lessons from highly ‘successful’ indie traders (think London Quant) who do development, it seems rolling your own library solution is definitely the way to go. I just don’t have really the time or energy to focus on maintaining large APIs like this. I just want to use leverage the power and extensible deployment options that Matlab brings. I have not yet seen anything as good but again, that is my experience only as I no longer debate about it. People can use what they want as it is a free world but I do document what works for me. It is like arguing with fools who have nothing better to do.

> As for FPGA, if you need that type of timing in order to be
> profitable, you are already facing a lot of limitations given that you
> are retail e.g. competing against players who have privileged access
> to the order book or the ability to submit special order types.
>  Doesn’t matter how fast you are.  They get the information before
> you 🙂

–> This is being regulated and investigated now by the NY State of Attorney and FBI! It will change and be equalized sooner than we know. It is quite possible that this whole model will be built around how IEX works. And dontchya know it, Interactive Brokers now support than as a gateway option.

Again, what is you specific goal here that started this dialogue?

 

Join my FREE newsletter to see how proceed with 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!

Is open source MyHDL from Python with potential ultra lowest latency with HDL for FPGA in an HFT deployment

Is open source MyHDL from Python with potential ultra lowest latency with HDL for FPGA in an HFT deployment

Want to learn more

Someone on my Twitter feed suggested this:

you should look at myhdl!

http://www.myhdl.org/doku.php

It looks like a way to do HDL from Python with potential ultra lowest latency with HDL for FPGA in an HFT deployment

Learn more on what tools I use for quant and HFT 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!

TONITE: Webinar of MATLAB Simulink model and Stateflow chart for trading with generation to C C++ HDL for HFT with FPGA deployment

TONITE: Webinar of MATLAB Simulink model and Stateflow chart for trading with generation to C C++ HDL for HFT with FPGA deployment

HI there

Want to know more? Join my FREE newsletter

This is an important milestone for me at QuantLabs.net. Anyone interested would be encouraged to join this online event:

This occurs TONITE on Monday May 13 at 7PM Eastern Standard Time

Topics include:

1. Sample trading model presented within Simulink with historical market data capture

2. Data flow of Stateflow visual chart for trading signal generation

3. Various techniques for C and C++ code generation walkthrough

4. Potential walkthrough of HDL or Verilog for FPGA deployment using Vertex or Xilinx boards. This is the ultra lowest latency option for those interested in HFT deployment

5. Question and answer period

Get more info here:

Get access here

Thanks Brya

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!

Webinar of MATLAB Simulink model and Stateflow chart for trading with generation to C C++ HDL for HFT with FPGA deployment

Webinar of MATLAB Simulink model and Stateflow chart for trading with generation to C C++ HDL for HFT with FPGA deployment

This occurs Monday May 13 at 7PM Eastern Standard Time

Topics include:

1. Sample trading model presented within Simulink with historical market data capture

2. Data flow of Stateflow visual chart for trading signal generation

3. Various techniques for C and C++ code generation walkthrough

4. Potential walkthrough of HDL or Verilog for FPGA deployment using Vertex or Xilinx boards. This is the ultra lowest latency option for those interested in HFT deployment

5. Question and answer period

This is EXCLUSIVELY for my QuantLabs.net Premium Members. Get access here.

Want more info? 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!

Is Matlab SImulink with C++ or FPGA HDL code generation most cost effective over any HFT trading platform software solution?

Is Matlab SImulink with C++ or FPGA HDL code generation most cost effective over any HFT trading platform software solution?

These interesting comments came from one of muy Youtube visitors: (thanks to him for sending these thoughts)

This got me thinking:

Want to learn more about this? Join my FREE newsletter

How do you tie matlab into execution without the performance hassles? Simulink can generate c++ code, but Deltix uses c# for script and can also use java for quantserver only.

 

You know, even at that price, after a few months time, each of you would be able to buy your own FPGA board from Dini et. al, anyway.

 

 

If it is possible for Simulink to implement an end-to-end system including execution from within matlab, you can apply that knowledge you gain from the process to FPGA execution

 

–> My response is this could be still the absolute best option for pricing, control of process, flexibility, and adaptability. Also, because of  Simulink code generation to C++, you should be able to easily bridge a FIX solution with even FPGA. Who know until we play right?

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 on Moving average trading model for HFT from Matlab Simulnk to FPGA HDL or Verilog for ultra lowest latency

Youtube video on Moving average trading model for HFT from Matlab Simulnk to FPGA HDL or Verilog for ultra lowest latency

–> JOIN NOW BEFORE THE QUANTLABS.NET PREMIUM MEMBERSHIP GO UP 50% <–

Join my FREE newsletter to see how I develop my custom automated trading system 

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!