Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.
Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.
Search the Community
Showing results for tags 'matlab'.
Found 3 results
Good morning everyone I saw a pairs trading webinar on the topic and found this code. I can not understand these two pieces of code, anyone is kind enough to explain % The strategy: % 1 Compute residuals over next N days res = series2 (i: i + N-1, 1) ... - (Reg1.coeff (1) + reg1.coeff (2). * Series2 (i: i + N-1, 2)); % 2 If the residuals are large and positive, then the first series % Is Likely to decline vs. the second series. Short the first % Series by a scaled number of shares and long the second series by 1% share. If the residuals are large and negative, do the % Opposite. indicated (i: i + N-1) = res / reg1.RMSE; s (i: i + N-1, 2) = (res / reg1.RMSE> spread) ... - (Res / reg1.RMSE <-spread); s (i: i + N-1, 1) = -reg1.coeff (2). * s (i: i + N-1, 2); end end Thank you very much for your cooperation ps do you know where I can find some code on the pairs trading?
Hello everyone, I have seen a lot of places state how certain candle stick formations such as a Marubozu or a hammer have a probability of being a reversal and even sites like thepatternsite.com has probabilities of each type of candle and its likelihood of a reversal or a big move, but I can not find any information on the internet about how to work out these probabilities myself. I was thinking of doing it in matlab but I was wondering if that was the best way to do it, is there any other ways that would be better or faster? If someone out there has all the data that I could see, that would be really interesting. I look forward to hearing your replies, Best regards, Vig
Hello. Long post coming. I’m looking at a solution to execute trading strategies I have in Matlab. I’m considering some options and I would appreciate some feedback on them. I have put the underlying history data in a MySQL database that I load from Matlab or into Java. The ideal situation for me is to have the data in MySQL, have everything related to the strategies in Matlab and have Java do the execution through QuickFIX/J, giving me maximum control over the important connection to my prime broker (who uses FIX interface). This is not HFT and I only trade a few times a day, an execution latency of 100-250ms is not of concern. These are some potential solutions I’ve come up with: 1. Use Matlab for prototyping only and then implement each strategy in Java, both using the common underlying database. This is certainly the most straight-forward solution but becomes really bad if you use any components in Matlab that are not directly available in Java. 2. Use Matlab for both strategies and execution. I have several problems with this. First I have to use a third-party package that I’m uncertain of how well tested it is and furthermore I feel more comfortable with Java handling the execution part. QuickFIX/J has even been recommended by the electronic trading services at my prime broker. 3. Use Matlab as a sort of server that Java queries from time to time (meaning that the controlling process would be Java). I like this option the most but I’m not sure of how to interact the components. Java would be sending inputs such as real-time market data and Matlab would output orders in stocks. Matlab has some startup-time (and data loading time in strategy) so it would be best if the Matlab process was continuously running. Otherwise Java could just start the entire strategy, have it output a file and Java reads the files… Any recommendation on how such communication could work? I’d love to hear how others have solved this problem. Regards, Alexander