Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Robb Trading Strategy

Table of Contents


Robb is a trading algorithm written in C# using the TradingMotion SDK development tools (there is a port too).

OHLC example chart Image footnote: Example of Robb OHLC financial chart showing some automatic trades

The strategy code is all contained in RobbStrategy.cs, including a default parameter combination.

This default parameter combination has been optimized to run over 30' bars of EuroStoxx Future Index.

Trading a maximum of 1 contract of ES50 Future, this is how performed (hypothetically) from 2001 to 20014:

Net P&L chart Image footnote: Hypothetic Net P&L chart for Robb strategy

Anyway, go open Visual Studio, clone the project and start with the trading algo development! Sure you can do better and improve all these figures :)

Robb Trading Rules

Robb's trading plan is quite simple. It sells 1 contract when the price breaks below a lower bollinger band.

While the strategy has a long position in the market, it places one exit order. A Take Profit (close the position with a profit) based on the standard deviation.

Besides, this is a pure intraday strategy. That means it won't leave any open position at the end of the session, so in case we still got a position it will be closed automatically.

To sum up

RobbStrategy rules:

  * Entry: Price breaks below lower Bollinger Band (short-only)
  * Exit: Sets a Take Profit (objective) order based on price standard deviation
  * Filters (sets the entry only under certain conditions): None

Show me the code

Here is a simplified C# source code of Robb's OnNewBar() function. The complete code is all contained in RobbStrategy.cs along with comments and definition of parameters.

// Sell signal: the price has crossed above the lower Bollinger band
if (this.Bars.Close[1] >= bollingerBandsIndicator.GetLowerBand()[1] && this.Bars.Close[0] < bollingerBandsIndicator.GetLowerBand()[0] && this.GetOpenPosition() == 0)
    // Entering short and placing a profit target 3 standard deviations below the current market price
    this.Sell(OrderType.Market, 1, 0m, "Enter short position");
    this.ExitShort(OrderType.Limit, this.Bars.Close[0] - standardDeviationIndicator.GetStdDev()[0], "Exit short position (profit target)");
else if (this.GetOpenPosition() == -1)
    // In Simple Order Management mode, Stop and Limit orders must be placed at every bar
    this.ExitShort(OrderType.Limit, this.GetFilledOrders()[0].FillPrice - standardDeviationIndicator.GetStdDev()[0], "Exit short position (profit target)");


First of all, make sure you have Visual Studio 2010 version (or higher). TradingMotion SDK is fully compatible with Visual Studio Express free versions.

Download TradingMotion Visual Studio extension, and the windows desktop application TradingMotionSDK Toolkit installer.

Quick Start

  • Create a free account to access TradingMotionAPI (required). It can be created from TradingMotionSDK Toolkit (the desktop application)
  • Clone the repository:
git clone
  • Open Visual Studio and load solution RobbStrategy/RobbStrategy.sln
  • Edit app.config file adding your TradingMotionAPI credentials on appSettings section

And you're all set!

Running the project (F5) will perform a development backtest simulation over last 6 months DAX 60' bars data.

Once it has finished, it will ask if you want to see the P&L report in TradingMotionSDK Toolkit. Pressing 'y' will load the same backtest with the desktop app, where it will show performance statistics, charts, and so on.

User Manual

More documentation in the Getting Started Guide

About iSystems

iSystems by TradingMotion is a marketplace for automated trading systems.

iSystems has partnered with 11 international brokers (and counting) that offer these trading systems to their clients (both corporate and retail) who pay for a license fee that the developer charges.

The trading systems run with live market data under a controlled environment in iSystems' datacenters.

This way the developers just need to worry about how to make their trading systems better and iSystems platform does the rest.

Visit Developers section on TradingMotion's website for more info on how to develop and offer your systems.


I am R&D engineer at TradingMotion LLC, and head of TradingMotion SDK platform. Beware, the info here can be a little biased ;)


Tyrion trading system C# port. An algorithmic trading system developed using TradingMotion SDK platform




No releases published


No packages published