Mentor low Latency C or C++ code

The original version of this article was published on Linked In where it has remained consistently popular.  This version is updated with additional content.

I do offer consulting services contact

I received a request to mentor low latency C/C++ code from several readers as a result of my last blog post “C++ faster than C# depends on the coding idom”    I love to mentor but thought it would help a larger group if I shared the some of the basic rules in a separate blog post.   I use these techniques for our Stock and Forex trading prediction engines but they are equally useful in most domains.   This is a huge topic area easily large enough to fill several books so please forgive items  I missed.
Continue reading “Mentor low Latency C or C++ code”

Expert Consultant Search, Browse, Discovery, Geo-Context Elastic Search

Expert Consultant in Search, Machine Learning and Distributed Architecture

We provide consulting to solve difficult Search, Discovery  and Machine Learning problems.   We are experts at applying Elastic search and Solar to Geo-contextual search in very large catalogs and consumer referral services.    We  are well proven consultants who consistently deliver innovative solutions to difficult problems.

Our ability to operate at both the business and techlogy level allows us to improve execution velocity  for initiatives that are important to business executives.  This can help IT teams deliver fast and get ahead of the delivery curve.

We have worked in senior levels so we understand business problems and can help executives meet their goals

joeeatbayesanalytic phone number Linked In Continue reading “Expert Consultant Search, Browse, Discovery, Geo-Context Elastic Search”

Sourcecode to save Forex Bar data to CSV via cAlgo bot

I needed this utility  to save 1 minute bar data tick data in a form where our AI / ML prediction engine could access it.     I needed the history but even more important  I needed the  something that could deliver new ticks to the prediction engine fast as they became available.

I cheated with this utility  and open the file in shared mode.  This allows my Lua code read new lines as they become available as if the data was delivered by a more traditional pipe. I tested the lua code which reads to the end of the file and then recognizes when new  data is available simply by continuing the read process.   When no data is available it returns immediately so you can do a very low cost poll without having to re-open or re-read any part of the file.   When I move to linux I can replace the file with a named pipe and eliminate the overhead of writing to disk.

Not a elegant architectural approach but it does keep the interface between my proprietary code and the 3rd party cAlgo product as thin as possible so I can change brokers easily in the future.

I was able to get it to deliver 1 minute bar data back to Jan-2011 which is the best source I have found for that much data.   Still has a flaw in that I could not figure out how to calculate actual transaction volume for the bar but will comeback to that when it is critical. .

http://ctdn.com/algos/cbots/show/599

Contact us

Lua jit tests faster than Julia for Stock Prediction Engine

Lua jit tests faster than Julia for Stock Prediction Engine

I started testing Julia as a possible alternative because Julia advocates claimed the interpreter loop was nearly as fast a C and it was similar in concept to Python which I love but which was too slow for our application.   I recently ran across a blog entry mentioning a new Lua Jit. I found it intriguing because Lua did quite well during our last round of tests.

Performance comparison Julia versus Lua Jit

Relative Execution Time. Lua Jit as baseline – lower is better  
Operation Lua52 LuaJit Julia Julia Typed Array
Parse File into Data Frame 2.42 1.0 5.64 5.64
Compute SMA(14) 2.81 1.0 6.87 0.70
Compute SMA(600) 33.32 1.0 80.00 1.30
Compute SMA_slice(14) 2.42 1.0 11.87 1.83
Compute SMA_slice(600) 33.32 1.0 15.52 5.90
Did not implement slice in Lua so re-used the timing from nested loop version.
Response times are in seconds.

Only 1 tested Julia operation was faster than Lua JIT

The only function where Julia out performed Lua Jit was in the SMA(14) all other items tested were slower.   I think the reason it did better in this instance is that the SMA function must allocate a new array with 71K rows to store the results. In Julia you can do this as a typed Array of float.   In Lua this is done as an append to list so it is allocating memory in little pieces. In the SMA(600) the Lua jit was faster again because it is doing more work compute in a tight loop relative to the memory allocation overhead.

Continue reading “Lua jit tests faster than Julia for Stock Prediction Engine”

Testing Julia for Predictive Engines, An early opinion

The programming language chosen for predictive trading systems depends on where you are in life cycle. If you want to produce code to validate ideas then the fewest lines of code to produce a working system tends to favor languages like F#, Python and Julia. Even for early ideas you sometimes have to deal with considerable data volumes so you still need reasonable speed.     If you are coding for live operations where speed is essential then C/C++ are the best choice especially when unplanned pauses from Garbage collectors are unacceptable.    Julia is a new language designed for speed in critical areas.  It isn’t perfect but overall I am impressed.
Continue reading “Testing Julia for Predictive Engines, An early opinion”

Optimize Retail Marketing ROI using Bayes Analytic

The Bayes Analytic engine provides a phenomenal ability to select customers that have a high probability of responding favorably to a given offer.     This kind of tuned campaign delivery would allow you to use the same marketing investment but run many more campaigns each of which is delivering additional revenue.     From the customer perspective you are presenting better  offers with products and services they actually want to buy so they pay more attention to your future communications.

Bayes Analytic is interested in partnering with leading consulting firms on behalf of their major customers who need to improve the number of closes per customer contact.
Continue reading “Optimize Retail Marketing ROI using Bayes Analytic”

Algorithm versus Strategy

I consider  Algorithm and Strategy as distinct concepts but in some language they could be interchangeable.

Algorithm

I consider an algorithm as a specific set of logical steps which are generally encapsulated as computer code that operate the same way and will give the same results when provided the same inputs every time they are executed unless the underlying logical steps are changed.

Continue reading “Algorithm versus Strategy”