← All Articles
Blueprint desk with technical precision gears assembling a trading strategy

Algorithmic Trading Fundamentals · Module 4 of 6

Build your first algorithmic trading strategy in three steps.

You have indicators. You have conditions. Now it's time to attach actions and build a complete, deployable trading strategy from scratch.

Austin Starks Austin Starks ✦ Founder, NexusTrade ✦ April 2026 ✦ 12 min read

Every strategy follows the same flow. Understand this, and you understand everything.

I spent two years trying strategies that didn't work.

RSI crossovers. 50-day SMA breakouts. Dollar-cost averaging into positions I had no real thesis for. Some of it made money. Most of it didn't. And the strategies that did work were usually the dangerous kind: leveraged plays that looked brilliant until the one time they didn't.

The Magnificent Seven rebalancing strategy was the first one I could actually defend.

The thesis was real. In 2021, I took my first intro to deep learning course. I understood, before it was obvious, what AI was going to become. NVIDIA, Google, Microsoft, Meta, Amazon, Apple, Tesla. These weren't just stocks. They were the infrastructure of the next era. Equal weight. Rebalance monthly. Stay in.

When I ran the backtest, it confirmed what I already believed. The returns were there. The Sharpe ratio held up. The drawdowns were manageable. Conviction backed by data. That was something I hadn't felt with any strategy before.

NexusTrade QuickTest results for Magnificent Seven rebalancing strategy: +27.6% total return, Sharpe 1.07, Sortino 1.59, Max Drawdown -17.3%
Magnificent Seven rebalancing strategy — QuickTest results: +27.6% total return, Sharpe 1.07, Sortino 1.59, Max Drawdown -17.3%.

That conviction became a strategy. And this module is about how that transformation happens: from a belief you carry in your head to a set of rules that runs without you.

Most traders have ideas. Few have rules. An idea is "I want to buy quality stocks when they're oversold." A rule is "if RSI is below 35 AND revenue grew more than 10% year-over-year AND price is below the 50-day SMA, then buy 5% of available cash." The difference between those two things is the difference between hoping and trading.

A strategy has exactly two parts: a condition and an action. The condition is a tree built from indicators. Base nodes compare two values and are combined with And/Or logic. When the tree evaluates to true, the action fires. That's all there is.

STRATEGY CONDITION tree of indicators And price < SMA(50) Base RSI(14) < 35 Base revenueYoY > 0.10 Base evaluates TRUE → action fires lhs indicator rhs indicator or value ACTION one per strategy type: "Buy" targetAsset: "AAPL" amount.type: "percent of buying power" amount.value: 5
A strategy is one condition and one action. The condition is a tree: an And node with Base conditions at the leaves, each comparing two indicators.

A trading strategy is just a set of rules. That's it. That's the whole secret.

After three modules of building blocks, we've arrived at the answer to the most important question: what is a trading strategy?

Watch · What is a Trading Strategy? — Putting It All Together

"A trading strategy is a set of rules for when you buy and sell stocks. It is composed of indicators, which create conditions, which execute actions."

Let's make that concrete with a real example strategy, the kind you might actually deploy:

Strategy 1 — "Oversold Quality Stocks"

IStrategy

{
  action: {
    type: "Buy",           // ActionEnum.BUY
    targetAsset: "AAPL",
    amount: {
      type: "percent of buying power",  // AllocationEnum.PERCENT_OF_BUYING_POWER
      value: 5
    }
  },
  condition: {
    type: "And",           // ConditionEnum.AndCondition
    conditions: [
      { type: "Base", lhs: "price",      comparison: "<",  rhs: "SMA(50)"       },
      { type: "Base", lhs: "RSI(14)",    comparison: "<",  rhs: 35              },
      { type: "Base", lhs: "revenueYoY", comparison: ">",  rhs: 0.10            },
      { type: "Base", lhs: "peRatio",    comparison: "<",  rhs: "sectorAvgPE"   }
    ]
  }
}

This strategy combines all four indicator types: a technical condition (price below SMA, RSI oversold), a fundamental condition (revenue growing, PE reasonable), and one buy action. Each strategy has exactly one action. If you want an exit rule, that's a separate strategy.

Strategy 2 — "Take Profit / Stop Loss"

IStrategy

{
  action: {
    type: "Sell",          // ActionEnum.SELL
    targetAsset: "AAPL",
    amount: {
      type: "percent of current positions",  // AllocationEnum.PERCENT_OF_CURRENT_POSITIONS
      value: 100
    }
  },
  condition: {
    type: "Or",            // ConditionEnum.OrCondition
    conditions: [
      { type: "Base", lhs: "positionReturn", comparison: ">=", rhs: 0.20  },
      { type: "Base", lhs: "positionReturn", comparison: "<=", rhs: -0.10 }
    ]
  }
}

Two strategies. One portfolio. Each has exactly one condition and one action. Both run automatically every day. That's all it takes.

Key insight

The complexity of a professional trading strategy doesn't come from mysterious math. It comes from combining many simple conditions with precise logic. Every rule is readable. Every rule is testable. That's what makes algorithmic trading auditable in a way gut-feel trading never is.

Want to try assembling one of these? Connect a Public.com brokerage account and get 3 months of NexusTrade Premium free — Aurora can build this exact strategy from plain English. The full course covers this module in an interactive video format.


Part of the free course

Algorithmic Trading Fundamentals

6 modules · No code required · Connect Public.com for 3 months Premium free

Two questions before we test your strategy.

Question 1

You believe NVIDIA will outperform when it's trading below its 50-day average and revenue growth is accelerating. How do you turn that into an algorithmic trading strategy?

Answer: The conviction maps directly to the strategy structure. The condition is an And node with two Base conditions: price < SMA(50) and revenueYoY > threshold. When both evaluate true, a Buy action fires, specifying the asset (NVDA), allocation type (percent of buying power), and amount. Your conviction becomes a set of rules. The rules run without you.

Question 2

A friend says their "strategy" is to buy when a stock feels oversold and sell when they've made enough. What's wrong with this, and why can't it be backtested?

Answer: There's no strategy here. Only a conviction. "Feels oversold" isn't a condition. "Made enough" isn't an action. Neither can be expressed as lhs indicator [comparator] rhs indicator. They can't be evaluated systematically, can't fire automatically, and can't be tested against historical data. Backtesting requires precise rules. Gut feelings don't compile.

Build your first strategy on NexusTrade

Tell Aurora what you want — she'll build the conditions, configure the actions, and have a strategy ready to backtest in minutes.

Get 3 Months Premium Free — via Public.com

Open a Public.com brokerage account, connect it to NexusTrade, and get 3 months of Premium free.  ·  Or take the full course →

Discussion

Sign in or create a free account to join the discussion.

No comments yet.