Correlation function now uses exponential moving average and calculated on this chart in abut 4 seconds, addforeign function code was slightly improved, this one must align data so it makes a search of every date in the main instrument to exists in foreign instrument - I made the search faster) , it took 20 seconds to align and add the foreign instrument which is quite fast considering there are 2 timeframes with almost 10000 bars each. The exponential average was a must use in correlation function as well without it the corr function was very slow using simple moving averages. All in all, as it can be seen bellow the chart this one was ready to use in 1 minute and 1 second which is acceptable if you ask me. 

Now, if I would think for a single second that my work would actually pay off someday I might be interested in doing things like this all over the program since I`m sure I can find some more places to improve the code, that is write it better to work faster, these were necessary though. 

    And with these I`m done with the functions however they are written, like I said if I were to take each one and check it I might find more things to improve. The code for the Accounts window is not 100% ready its in a state like the corr and addforeign functions were before today not necessarily in speed because in there there is no such problems but in terms of being checked and making sure it actually does the things as it should - a lot of calculations there and very various as the instruments and methods are many not to speak about their combinations so its a complicated thing, and to really relay on it I should use it for myself but I don`t trade anymore, maybe though slowly and when I`m in the mood I will work at it. Thing is that is all its left to compile the program, I could compile it without that but with or without it I got no reason to do so

    I almost forgot, this is the formula used to  plot the chart.

    Formula language is proprietary and the entire programming language code was invented by me, the language its quite similar with Metastock formula language and Amibroker formula language which were the two languages I had in mind when I wrote the code for the programming language. Is array based programming language but just now that I wrote this text in this post I remembered I would like it to be able do do some loops and I should add user defined arrays, how the fuck to to that is something I have to think about...

    

Comments