GithubHelp home page GithubHelp logo

shawnallen85 / tradesharp-core Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trade-nexus/tradesharp-core

0.0 1.0 0.0 76.86 MB

TradeSharp Backend code. TradeSharp is a C# based data feed and broker neutral Algorithmic Trading Platform that lets trading firms or individuals connect to providers, and automate any rules based trading strategies in stocks, forex and ETFs.

Home Page: http://www.tradesharp.se

License: Apache License 2.0

C# 99.82% PowerShell 0.02% HTML 0.10% Batchfile 0.06%

tradesharp-core's Introduction

IMPORTANT

This is an old project and hasn't been actively maintained since 2015 and we're not providing any paid support for it.

TradeSharp

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.


Table of contents


Installation

Download and install the following tools to setup development environment for working with TradeSharp.

  1. Microsoft Visual Studio 2012 or higher
  2. .NET Framework 4.5.1
  3. MySQL
  4. Git
  5. Wix
  6. RabbitMQ
  7. Resharper (Visual Studio extension for .NET Developers )
  8. SourceTree (GIT client for windows)

Code Cloning

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.

  1. Clone TradeSharp backend (tradesharp-core):
  2. 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.

Setting Up Database

  1. Create a new database named Tradehub.
  2. Settings:
    • UserName: root
    • Password: root
    • Host: localhost
  3. Run sql script C:\trade-nexus\tradesharp-ui\database\TradeHubDBScript.sql

To load data from workbench

  1. Open MySQL Workbench
  2. Click on “Local Instance MySQL” and enter password when prompted
  3. From top menu bar, click on Server -> Import Data
  4. Select import from self-contained file and provide path to ‘TradeHubDBScript.sql’ file
  5. Select “TradeHub” as target schema
  6. Press ‘Start Import’ button
  7. Restart workbench to ensure tables are present in db

Opening Code With Visual Studio

  1. Run Visual Studio
  2. Click on File -> Open -> Project/Solution…
  3. In the new windows that opens, navigate to the tradesharp-core code cloned C:\trade-nexus\tradesharp-core\Backend
  4. Select TradeHub.sln
  5. Run another instance of Visual Studio
  6. Click on File -> Open -> Project/Solution…
  7. In the new windows that opens, navigate to tradesharp-ui code cloned C:\trade-nexus\tradesharp-ui
  8. Select TradeHubGui.sln

Enabling Test Code to Simulate Service Start

This step is important to perform before running TradeSharp locally without installer

  1. In Visual Studio instance with tradesharp-ui code, open TradeHubGui\ViewModel\ServicesViewModel.cs
  2. Find PopulateServices() method and then locate comments “//NOTE: Test code to simulate Service Start” “// BEGIN:”
  3. Uncomment the block of code that follows till “// :END” comment
  4. Locate comment “// Disbaled for testing” in the same method near the end and comment the line of code “InitializeServices();”
  5. 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
 }

Changing ROOT DIRECTORY PATH

This step is important to perform before running TradeSharp locally without installer

  1. In Visual Studio instance with tradesharp-ui code, open TradeHubGui\TradeHubGui.Common\Constants\DirectoryPath.cs
  2. Comment line public static string ROOT_DIRECTORY_PATH = Path.GetFullPath(@"~....");
  3. 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\\";

Running Application

  1. 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
  2. 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
  3. 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

Viewing Logs

  1. Log Locations
    • TradeSharp Logs in ProgramData folder: (C:\ProgramData\TradeSharp Logs)
    • Note: ProgramData folder may be hidden
  2. 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*

Bugs

Please report bugs here

tradesharp-core's People

Contributors

hasnainasyed avatar rasheedamir avatar abaziz avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.