Posted 10/10/2006 22:00:02
|
|
|
|
| One of the well tucked away features of RightEdge is the ability to distribute systems without source code. For system writers, this is a great way to protect intellectual property. After you open/create a system, there is an Export Trading System menu item located off of the File menu. This will create a folder underneath the folder where your source code resides. The folder is named <system name>_redist. This folder will contain the RightEdge project file (.rep extension) and the compiled DLL (assembly). This is all that is needed to run this system. Redistribute those two files (and any dependencies) and it's ready to go.
|
|
Posted 12/24/2006 06:49:40
|
|
|
|
First of all, excuse my english. I am not a natural english speaker and writer:
The dll can be deployed without sources this way. But I got the following results by reflecting a compiled testlibrary.
// Example code of the Getting Started Section from inside RightEdge
using System;
using System.Drawing;
using System.Collections.Generic;
using RightEdge.Common;
using RightEdge.Indicators;
public class SystemMain : SystemBase
{
public override void Startup()
{
// Perform initialization or set system wide options here
this.SystemData.ProfitTarget = SystemParameters["ProfitTarget"]; // 5%
this.SystemData.BarCountExit = Convert.ToInt32(SystemParameters["BarCountExit"]);
GC.Collect();
}
public override void NewSymbolBar(Symbol symbol, BarData bar)
{
// This line of code runs the actions you have set up in in the Project Form
Actions.RunActions(symbol);
ISeries widnerLower = Indicators["Widner Lower Band"][symbol];
double targetPrice = widnerLower[widnerLower.Count - 1];
string id = string.Empty;
this.SystemData.OpenPosition(symbol, PositionType.Long, OrderType.Limit, targetPrice, out id);
}
}
After compiling and exporting I analyed the dll with .NET Reflector and got the following code.
public override void Startup()
{
base.SystemData.ProfitTarget = base.SystemParameters["ProfitTarget"];
base.SystemData.BarCountExit = Convert.ToInt32(base.SystemParameters["BarCountExit"]);
GC.Collect();
}
public override void NewSymbolBar(Symbol symbol, BarData bar)
{
base.Actions.RunActions(symbol);
ISeries series1 = base.Indicators["Widner Lower Band"][symbol];
double num1 = series1[series1.Count - 1];
string text1 = string.Empty;
base.SystemData.OpenPosition(symbol, PositionType.Long, OrderType.Limit, num1, out text1);
}
-----
As you can see some vars have been renamed and the comments are lost also. But the content is still readable and understandable.
The export is not a good way to protect your ideas.
Now to my opinion: I would never invest through a mechanic that I don't understand because it is source protected and running as a blackbox.
Best Regards
Stephan
|
|
Posted 12/27/2006 10:23:51
|
|
|
|
| Yes, reflector will do a pretty good job of exposing the code. You've got two choices for adding a bit more protection, though. 1. Obsfucators. These programs are used to scramble the generated IL and work pretty well when used on a large programmer. Sure, someone determined can still likely figure out what is going on, but it does make it a bit of a pain. Googling for "C# Obsfucator" will return quite a few products. 2. Using the built in NGEN.EXE. NGEN.EXE compiles a .NET exe or dll to machine code and makes it very difficult to peak. The only real issue with using NGEN is that it targets the CPU (optimizes for) where the compilation is performed. Of course, if you wrote a really fancy system you might consider an installer for it that ran NGEN on the end users machine.
|
|
Posted 12/28/2006 13:14:27
|
|
|
|
I wanted to add that RightEdge compiles your trading modules in debug mode. This is so that if there is an exception you will be able to see the line numbers in your code in the stack trace. But it also makes the decompiled code quite readable.
In the end, if you are giving someone a black box to run on their computer, a determined hacker will always be able to "open up" that black box and see how it works. Using an obfuscation tool is probably the best way to protect your code from most users.
|
|
Posted 1/29/2010 07:06:58
|
|
|
|
I tried to export my trading system and got error:
An exception of type System.NullReferenceException was thrown.
Odwołanie do obiektu nie zostało ustawione na wystąpienie obiektu.
w RightEdge.xe5110d3d5083f078.ExportProject()
w RightEdge.xf266856f631ec016.x07e59eb4f23cedd5(Object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
Edition 2 Beta 14
Btw. what are the most efficient ways to obfuscate/secure my RE strategy code?
It's very important because RE will trade on VPS hosting machine.
|
|
Posted 1/29/2010 10:22:04
|
|
|
|
This appears to be an obfuscation overreach on our part. We'll have that addressed very shortly.
For obfuscation purposes, you can use any off the shelf obfuscation solution.
Largo (1/29/2010)
I tried to export my trading system and got error:
An exception of type System.NullReferenceException was thrown.
Odwołanie do obiektu nie zostało ustawione na wystąpienie obiektu.
w RightEdge.xe5110d3d5083f078.ExportProject()
w RightEdge.xf266856f631ec016.x07e59eb4f23cedd5(Object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
Edition 2 Beta 14
Btw. what are the most efficient ways to obfuscate/secure my RE strategy code?
It's very important because RE will trade on VPS hosting machine.
|
|
Posted 1/30/2010 12:50:20
|
|
|
|
Next things:
1. When I export trading system then it's only generated .dll without .rep file.
2. When I try to run live project from command line it does not starts because in WatchList there is no selected any symbol.
It is probably a bug that last selection is lost after restarting RE.
Ed.2 Beta 14
|
|
Posted 1/30/2010 21:38:34
|
|
|
|
1. This is due to the NullReferenceException bug. It should work correctly in the next build. It should also work in the current build if you change the system frequency to something besides "Automatic". You can always load the exported system and change the frequency back to Automatic later.
2. You need to specify what watchlist folder to use on the command line with the "/W:" switch. See the Automating RightEdge section of the documentation.
Thanks,
Daniel
|
|
Posted 1/31/2010 05:40:29
|
|
|
|
| ad.2 Of curse I had /W parameter - this problem is not only when starting from command line, it's every RE restart (previous selected watchlist elements are not checked after restarting RE).
|
|
|
|