It seems that C# code, just like Java, are quite easy to decompile.
C# is not as fast as some real compiled languages like C.
I'm trying to avoid/limit these drawbacks.
The idea is, for NT strategies, is to write the core of the strategy logic in an "harder to decompile" language, C++ for example, and let the NT C# indicators sending to the C++ program the needed data for taking the right decisions.
- is this a silly idea ?
- does someone here has already played with something like this ?
I've started something, the C# coded strategy use a socket, to talk to a "strategy server", which send back to the NT strat what to do, but if somebody has already done this kind of job, well, I don't want to reinvent the wheel .
since you already use sockets to talk to that strategy server, you may think about placing startegy server remotely .... thus the local "strategy" on the client side would be just a dummy.
Disadvantage - latency, no offline operation, backtesting might not work....
advantage - since the core of the code is not present on the client side there might not be much to crack .... lol
Thx for answers.
@sefstrat: I'm a Unix/Linux guy, I have made a lot of socket and other IPC stuff, socket is much more easier for me than interop things (interop == 我愛奶酪和法國葡萄酒 for me, and I don't write/speak chinese ).
@toulouse-lautrec: my "strategy server" is already on another machine, so the client part can be decompiled, I don't care...
@bukkan: I've tested few obfuscators, but none were perfect, and I like the idea of having the core logic deported somewhere else.
Backtesting will not be possible, but as I don't really trust NT backtests, it's ok for me.
Latency does not seems to be a problem, because most of the data needed to decide what to do are already on the remote server.
then inside your class define method signature from c++ dll, for example:
private static extern bool MethodName(float Open, float Close, float High, float Low, int dateStamp, out float var1, out float var2, out float var3);
then you can just call it like a normal managed method =)
But yeah if you are really interested in security then keep the sensitive parts on the server side, that is the only way to guarantee they can't be decrypted/deobfuscated. Then the only issue is latency but that is probably workable as long as you aren't doing very high frequency trades.
The following user says Thank You to sefstrat for this post:
Thx sefstrat, I'll take a look at how to use managed interop, it can be useful in another context.
The strats I'm working on are not "high frequency", they are supposed to still profitable with a 800/1000 ms delay.
I've been working for a big bank, which was playing with "high frequency trading", this is another world...
I am currently also thinking of making some of my creations available to a some people, and would like to protect the code as effectively as possible.
The solution recommended by NT has some serious issues (which i am not going to discuss here), so if anyone has any recommendations (free or commercial) i would be very happy to hear about it.
I have spent some time browsing around and looking at solutions available, there seem to be many, which makes it not easy.
Any comments, also via PM, would be appreciated.