Skip to content

Create Your First Strategy

  • Make sure TradeHub is running on your device and accessible in your browser.

Here’s a quick overview of the main parts of the TradeHub interface.
The top bar contains the Strategy Lab controls, and the left menu is for Navigation. Main Lab Layout

The following items are explained from left to right, respectively.

  • Open – Create or Load an existing strategy.
  • Save – Save your current strategy.
  • Indicator – Add or edit indicators.
  • Market – Select trading pair — Exchange account must be added in settings for Live trade.
  • Trader Mode – Choose between trader modes : Backtest, Paper or Live
  • Run – Start trader bot with choosen mode.
  • Stop – Stop current run.

Main Lab Layout The following items are explained from top to bottom, respectively.

  • Strategy Lab – Main workspace for creating strategy and testing.
  • Session History – Review past trader sessions or runs.
  • Active Traders – View or manage active traders. — Only for Live and Paper modes
  • Market Data – Download and manage market history data for backtest.
  • Docs – Open this documentation.
  • Status – Web UI connection indicator with TradeHub.

Before creating your first strategy you need a market data for backtesting, click Market Data in main navigation. Market Data Page

The Market Data page has two sections: Downloader and Downloaded Markets List.

  1. Select Exchange

  2. Select Market

  3. Select Timeframe

  4. Select Start Date and End Date

    • Or use the Quick Selection buttons: 1M, 3M, 6M, 1Y, MAX
    • MAX automatically selects the largest possible date range allowed by your plan. Note: Data for the entire MAX range may not be available from the exchange.
  5. Click Start Download to begin downloading.


  1. Click ‘Open’ from the sidebar navigation.

    • Press New Strategy at pop-up menu.
      Open Strategy
  2. Name Your Strategy and Choose Your Editor
    Choose something descriptive like EMA Cross Trend Follower.
    Name Your Strategy

  1. Save
    Just click Save at the top left — it’s as simple as that!
    To open a saved strategy later, click My Strategies in step 1. A list of your strategies will be displayed.

In the previous step, you learned how to create and open a strategy. Now, let’s see how to select market data for your strategy to backtest.

Select Market

  1. Click the Market button on the top bar to open the market selection menu.
  2. A list of your downloaded markets will appear.
  3. Choose the market you want to backtest.
  4. Select the date range for testing — it uses the same date range selector as the Market Data Downloader, and Quick Selection options (1M, 3M, 6M, 1Y, MAX) are also available.

In your strategy, follow these steps to add or manage indicators:

  1. Click Indicator in the top bar.
  2. The indicator menu opens and shows the indicators currently used by the strategy. (If this is your first indicator, the list will be empty.) Add Indicator
  3. From the left menu, click Indicators to view the built-in indicators. Select Indicator
  4. Select the indicator you want to add. The Indicator Form modal will open. Indicator Form
    • Alias is the name you use in your strategy code to access an indicator’s value. By default, it is set to the indicator’s short name. For example, if you add multiple EMA indicators, you can rename them to ema_fast and ema_slow to differentiate between them.
    • The form displays inputs and parameters for the selected indicator.
    • Default values are shown for convenience; they are common settings, not necessarily the best for your strategy.
  5. Adjust the inputs or parameters as needed.
  6. Click Add to add the indicator to your strategy.
  7. Close indicators modal by pressing Esc or clicking the Close button in the top-right corner.
  8. To edit or remove an indicator later, simply open the Indicator menu again and use the edit or remove options.

Let’s write a simple RSI strategy to test our first bot.

// Called once when the strategy is created or loaded
// Can be async if you need to fetch or prepare data
function setup() {
// Initialize variables, indicators or require a plugin here
}
// Called on each market update (e.g., new candle or tick)
async function update() {
// Main trading logic goes here
// Example logic:
// - Buy when RSI crosses above 30 (oversold)
// - Sell when RSI crosses below 70 (overbought)
if (ta.crossup("rsi", 30)) {
await order.buy();
} else if (ta.crossdown("rsi", 70)) {
await order.sell();
}
}

After adding the code:

  1. Set Trader Mode to Backtest from the top bar.
  2. Click Run at the top right to start the backtest.

You’ll now see how your strategy performs based on historical market data.



  • Can’t see new strategy? Refresh the page or check if it was saved correctly.
  • No trades during simulation? Verify your indicators and conditions.
  • Strategy not saving? Ensure you didn’t remove required fields (name, market, etc.).

Continue to: Running Your First Simulation