Trade Ideas Custom Formula Examples 

trade-ideas custom formula examples

We are reader-supported. When you buy through links on our site, we may earn a commission (see affiliate policy).

One of the most powerful features in Trade Ideas is the ability to create custom formulas for technical analysis. Whether you’re a seasoned trader or just starting out, building your own indicators can help you spot opportunities faster, filter noise, and make more confident decisions.

Below, we’ll walk through a few practical ways to use Trade Ideas’ custom formulas—plus two example formulas you can start using right away.

Why Use Custom Formulas?

Custom formulas in Trade Ideas let you go beyond standard indicators. You can combine multiple signals, define specific timeframes, or build logic tailored to your trading style. Some popular use cases include:

  • Combining moving averages like SMA and EMA into a single signal
  • Measuring momentum based on percentage price change
  • Filtering alerts by time of day or volume spikes
  • Creating your own entry/exit rules

Let’s look at a few of these in more detail.

Volume Surge Detection

Formula: v_up_1 / v_up_5 * 5

This formula compares the volume in the last 1 minute to the average volume over the past 5 minutes, scaled up for easier interpretation. It highlights unusual buying pressure—potentially indicating accumulation or a breakout setup.

To filter only meaningful spikes, set a MIN value (e.g. 2.0) so you only see alerts when the current volume is double or more the recent average. This helps you catch real momentum shifts and avoid false positives caused by normal market noise.

Why it works:
It gives a quick read on whether buyers are stepping in aggressively, which often precedes price movement.

Time-Based Filters

Formula: seconds_after_open / 60 / 60

This one converts the number of seconds since market open into hours. It’s useful for isolating signals that occur within specific intraday windows—like the high-volatility first hour.

Use Cases:

  • To scan only the first hour of trading, set:
    • MIN = 0
    • MAX = 1
  • To look at weekly or monthly trends, convert days into hours:
    • Last 7 days = MIN = 168
    • Last 30 days = MAX = 720

This filter lets you run strategies based on time of day or recency, whether you’re a scalper or a swing trader.

Detect High Relative Volume

Formula:
v / avgvol

What it does:
Compares current volume (v) to average volume (avgvol) to find stocks trading with unusually high activity.

Example Filter:
Set MIN = 2 to find stocks trading at least 2x their average volume, often a sign of strong interest or news-driven moves.

Strong Momentum (Intraday Price Spike)

Formula:
(close - open) / open * 100

What it does:
Calculates % price change since the open. This is a quick momentum gauge to spot stocks making a strong move intraday.

Example Filter:
MIN = 3 finds stocks up more than 3% on the day.

Early Morning Spike Filter

Formula:
seconds_after_open / 60 / 60

What it does:
Returns the number of hours since market open. Used to filter scans by time of day.

Example Filters:

  • Pre-market (if available): MIN = -1, MAX = 0
  • First hour: MIN = 0, MAX = 1
  • Power hour (last hour of trading): MIN = 6, MAX = 7

EMA vs. SMA Trend Confirmation

Formula:
ema20 > sma50

What it does:
Finds stocks where the 20-period EMA is above the 50-period SMA—often used as a bullish trend confirmation.

Example Filter:
This can be used as a Boolean (true/false) filter in your scans. Returns only stocks in a confirmed short-term uptrend.

Volume Spike Last 1 Min vs 5 Min

Formula:
v_up_1 / v_up_5 * 5

What it does:
Detects sudden bursts of buying by comparing recent volume over 1 minute vs average of last 5 minutes.

Example Filter:
MIN = 2.0 flags moments where there’s at least 2x volume surge, which can be the start of a breakout.

Strong Close (Near High of Day)

Formula:
(close - low) / (high - low)

What it does:
Measures where the price closed relative to the day’s range. A value close to 1 means price closed near the high of day (HOD).

Example Filter:
MIN = 0.8 shows stocks closing in the top 20% of their daily range—often seen in strong uptrending names.

Percentage Gap from Previous Close

Formula:
(open - closey) / closey * 100

This shows the percentage gap between today’s open and yesterday’s close. Helpful for pre-market or open gap scans.

Use MIN = 4 to find stocks that gapped up more than 4%, or MAX = -3 to find gap-downs of more than 3%.

Daily Range Strength

Formula:
(close - low) / (high - low)

Measures how strong the close was compared to the full daily range. A result near 1 indicates a close near the high of the day.

Use MIN = 0.85 to find strong closing momentum.

Price Above Key Moving Averages

Formula:
close > sma20 and close > sma50 and close > sma200

A simple trend confirmation showing the stock is trading above all major moving averages.

Use this to filter for stocks in a strong uptrend.

Volatility Squeeze Setup

Formula:
(high - low) / close < 0.01

This finds stocks with very tight intraday ranges, a common sign before a breakout or reversal.

Use this with additional filters like high relative volume or a recent spike in premarket.

Relative Strength (Last 5 Days)

Formula:
(close - close5) / close5 * 100

Shows percentage gain over the last 5 days. A good way to find recent outperformers.

Set MIN = 5 to find stocks that gained at least 5% over the past week.

Price Near High of Year

Formula:
(close / highy) > 0.95

Shows how close the current price is to the 52-week high. Can be used to spot momentum setups.

Set MIN = 0.95 to find stocks within 5% of their yearly high.

Price Crossing Over Moving Average

Formula:
close > sma20 and closey < sma20y

This detects a bullish crossover where the stock closed today above the 20-day SMA, after being below it yesterday.

Useful for mean-reversion or momentum breakout strategies.

Bonus Tip: Always Backtest

No matter how elegant your formula is, don’t go live without testing it. Use Trade Ideas’ backtesting tools on historical data to validate that your custom indicators actually perform as intended. This step will help you avoid curve-fitting or relying on randomness.

Final Thoughts

Trade Ideas’ custom formulas open the door to more personalized, powerful scans. You’re not limited to off-the-shelf indicators—tailor your strategy to how you trade. Whether you’re tracking volume spikes, momentum shifts, or specific time windows, a well-crafted formula can sharpen your edge.

Ready to experiment? Start small, test thoroughly, and keep iterating. The full list of Trade Ideas custom formula examples are here.