This is an old project and hasn't been actively maintained since 2015 and we're not providing any paid support for it.
TradeSharp is a C# based data feed and broker neutral Algorithmic Trading Platform that lets trading firms or individuals automate any rules based trading strategies in stocks, forex and ETFs.
Find more about TradeSharp here.
- Installation
- Code Cloning
- Setting Up Database
- Opening Code With Visual Studio
- Enabling Test Code to Simulate Service Start
- Changing ROOT DIRECTORY PATH
- Running Application
- Viewing Logs
- Reporting Bugs
Download and install the following tools to setup development environment for working with TradeSharp.
- Microsoft Visual Studio 2012 or higher
- .NET Framework 4.5.1
- MySQL
- Git
- Wix
- RabbitMQ
- Download and install erlang: http://www.erlang.org/download.html
- Restart System
- Download and install RabbitMQ: http://www.rabbitmq.com/download.html
- For Installation Problems: http://www.rabbitmq.com/install-windows.html
- Resharper (Visual Studio extension for .NET Developers )
- Download and Install Resharper: https://www.jetbrains.com/resharper/
- SourceTree (GIT client for windows)
- Download and Install SourceTree: https://www.sourcetreeapp.com/
It is highly recommended that you clone the TradeSharp repositories in C:\trade-nexus directory as doing so would make things easier when creating the TradeSHarp installer.
- Clone TradeSharp backend (tradesharp-core):
- Clone TradeSharp frontend (tradesharp-ui):
Assumptions:
It is assumed in the remianing document that the location for tradesharp-core (TradeSharp Backend) is C:\trade-nexus\tradesharp-core and location for tradesharp-ui (TradeSharp Frontend) is C:\trade-nexus\tradesharp-ui.
- Create a new database named Tradehub.
- Settings:
- UserName: root
- Password: root
- Host: localhost
- Run sql script C:\trade-nexus\tradesharp-ui\database\TradeHubDBScript.sql
To load data from workbench
- Open MySQL Workbench
- Click on “Local Instance MySQL” and enter password when prompted
- From top menu bar, click on Server -> Import Data
- Select import from self-contained file and provide path to ‘TradeHubDBScript.sql’ file
- Select “TradeHub” as target schema
- Press ‘Start Import’ button
- Restart workbench to ensure tables are present in db
- Run Visual Studio
- Click on File -> Open -> Project/Solution…
- In the new windows that opens, navigate to the tradesharp-core code cloned C:\trade-nexus\tradesharp-core\Backend
- Select TradeHub.sln
- Run another instance of Visual Studio
- Click on File -> Open -> Project/Solution…
- In the new windows that opens, navigate to tradesharp-ui code cloned C:\trade-nexus\tradesharp-ui
- Select TradeHubGui.sln
This step is important to perform before running TradeSharp locally without installer
- In Visual Studio instance with tradesharp-ui code, open TradeHubGui\ViewModel\ServicesViewModel.cs
- Find PopulateServices() method and then locate comments “//NOTE: Test code to simulate Service Start” “// BEGIN:”
- Uncomment the block of code that follows till “// :END” comment
- Locate comment “// Disbaled for testing” in the same method near the end and comment the line of code “InitializeServices();”
- Find StopService() method in the same file and repeat steps 2-3.
// ServicesViewModel.cs
...
private void PopulateServices()
{
...
//NOTE: Test code to simulate Service Start
// BEGIN:
availableService.Status = ServiceStatus.Starting;
availableService.Status = ServiceStatus.Running;
// :END
////NOTE: To be disbaled for testing
//InitializeServices();
}
...
...
private void StopService(string serviceName)
{
...
//NOTE: Test code to simulate Service Start
// BEGIN:
serviceDetails.Status = ServiceStatus.Stopping;
serviceDetails.Status = ServiceStatus.Stopped;
return;
// :END
}
This step is important to perform before running TradeSharp locally without installer
- In Visual Studio instance with tradesharp-ui code, open TradeHubGui\TradeHubGui.Common\Constants\DirectoryPath.cs
- Comment line public static string ROOT_DIRECTORY_PATH = Path.GetFullPath(@"~....");
- Uncomment line public static string ROOT_DIRECTORY_PATH = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\TradeHub\";
//public static string ROOT_DIRECTORY_PATH = Path.GetFullPath(@"~\..\..\");
//// NOTE: For running application locally
public static string ROOT_DIRECTORY_PATH = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\TradeHub\\";
- Compiling Code (When running the code for the first time or after making changes)
- Click on Build->Clean Solution from top menu bar
- Click on Build->Build Solution
- Starting the Backend
- In the Visual Studio instance with TradeSharp Backend code, locate and expand MarketDateEngine in the solution explorer.
- Right click on TradeHub.MarketDataEngine.Server.Console
- Click on Debug->Start new instance
- If everything is fine a new console window should open up
- Locate and expand OrderExecutionEngine
- Right click on TradeHub.OrderExecutionEngine.Server.Console
- Click on Debug->Start new instance
- If everything is fine a new console window should open up
- Starting the tradesharp-ui
- In Visual Studio instance with tradesharp-ui code, right click on TradeHubGui project and Set as startup project
- Click on Start from the top menu bar
- Log Locations
- TradeSharp Logs in ProgramData folder: (C:\ProgramData\TradeSharp Logs)
- Note: ProgramData folder may be hidden
- Some log files are created in component Debug folders. For example after running MarketDataEngine Console, log file will be created in *C:\trade-nexus\tradesharp-core\Backend\MarketDataEngine\TradeHub.MarketDataEngine.Server.Console\bin\Debug*
Please report bugs here