Protecting code - NinjaTrader Programming | futures io social day trading
futures io futures trading


Protecting code
Updated: Views / Replies:11,829 / 30
Created: by sam028 Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Protecting code

  #1 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,574 given, 3,982 received

Protecting code

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.
Questions:
- 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 .

Reply With Quote
 
  #2 (permalink)
Elite Member
Austin, TX
 
Futures Experience: Advanced
Platform: NT/Matlab
Broker/Data: Interactive Brokers
Favorite Futures: FX majors
 
sefstrat's Avatar
 
Posts: 285 since Jun 2009
Thanks: 20 given, 749 received

Many of the commercial indicators work this way, calling external c++ dlls, for instance the Kase Statware, Kwikpop and Jurik indicators all do this.

You don't need to use sockets though, you can use managed interop to call c++ methods straight from c#.

Reply With Quote
The following 2 users say Thank You to sefstrat for this post:
 
  #3 (permalink)
Elite Member
Europe
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 73 since Jun 2009
Thanks: 11 given, 52 received



sam028 View Post
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

Reply With Quote
 
  #4 (permalink)
Elite Member
Calcutta, India
 
Futures Experience: Intermediate
Platform: ArthaChitra
 
Posts: 278 since Jun 2009
Thanks: 161 given, 259 received


sam028 View Post
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.
Questions:
- 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 .

you need to obfuscate the dll. try this free obfuscator.

Eazfuscator.NET ? Free .NET Obfuscator

Reply With Quote
 
  #5 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,574 given, 3,982 received

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.

Reply With Quote
 
  #6 (permalink)
Elite Member
Austin, TX
 
Futures Experience: Advanced
Platform: NT/Matlab
Broker/Data: Interactive Brokers
Favorite Futures: FX majors
 
sefstrat's Avatar
 
Posts: 285 since Jun 2009
Thanks: 20 given, 749 received

managed interop is as simple as..

using System.Runtime.InteropServices;

then inside your class define method signature from c++ dll, for example:

[DllImport("myUnmanagedDll.dll")]
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.

Reply With Quote
The following user says Thank You to sefstrat for this post:
 
  #7 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,574 given, 3,982 received

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...

Reply With Quote
 
  #8 (permalink)
Elite Member
Europe
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 73 since Jun 2009
Thanks: 11 given, 52 received

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.

Reply With Quote
 
  #9 (permalink)
Elite Member
Austin, TX
 
Futures Experience: Advanced
Platform: NT/Matlab
Broker/Data: Interactive Brokers
Favorite Futures: FX majors
 
sefstrat's Avatar
 
Posts: 285 since Jun 2009
Thanks: 20 given, 749 received

Don't waste your money on anything commercial, any .net protection can be reversed all the way back to IL code quite easily by someone who knows what they are doing.

Most secure way of course is to code all the important parts in c++, other than that obfuscation is your best bet.

Here is a good, free obfuscator: NTCore's Homepage

Reply With Quote
The following user says Thank You to sefstrat for this post:
 
  #10 (permalink)
 Vendor: www.tradingstudies.com 
Denver, CO
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Amp Futures/Zen-Fire
Favorite Futures: TF, ES, CL
 
roonius's Avatar
 
Posts: 132 since Jun 2009
Thanks: 20 given, 272 received



toulouse-lautrec View Post
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.

NT recommends Remotesoft.
What issues are you talking about?

Reply With Quote

Reply



futures io > > > > > Protecting code

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Common code re-use LostTrader NinjaTrader Programming 12 October 5th, 2011 06:50 PM
Protecting Your Retirement Portfolio Against Inflation Quick Summary News and Current Events 0 April 25th, 2011 07:20 PM
Can someone code this ? skyfly NinjaTrader Programming 8 April 25th, 2011 01:40 PM
Help with code error kashter NinjaTrader Programming 10 March 8th, 2011 12:16 PM
Protecting the cumulative profit target in an automated strategy nanobiotech NinjaTrader Programming 4 April 1st, 2010 12:24 PM


All times are GMT -4. The time now is 10:35 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-16 in 0.14 seconds with 19 queries on phoenix via your IP 54.227.51.103