Skip to content

Add real-time market risk filtering to Freqtrade strategies. Block high-risk trades in seconds with a simple snippet - no dependencies required.

License

Notifications You must be signed in to change notification settings

DonaldSimpson/remora-freqtrade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Market Awareness for your Freqtrade Strategies

License: MIT

Website Blog Backtests Freqtrade

Remora Risk Engine - Stop Bad Trades Before They Happen

Market awareness layer for your Freqtrade strategies. Add real-time risk filtering with a simple API call - transparent, fail-safe, and easy to remove.

Remora lets you know if the current market conditions are safe to trade in. It answers "Should I be trading at all right now?" - not "Is this a good entry?"

How it works:

Your Strategy → Remora API Check → Filtered Trades
     ↓                ↓                    ↓
  Entry Signal    Risk Assessment    Safe Entries Only

What Remora Does

  • ✅ Lets you know if current market conditions are safe to trade in
  • ✅ Blocks trades during high-risk periods (volatility spikes, regime changes, extreme fear, etc.)
  • ✅ Provides full transparency (returns reasoning, not just boolean)
  • ✅ Uses multiple data sources with redundancy and failover
  • ✅ Market awareness layer specifically built for Freqtrade strategies

What Remora Does NOT Do

  • ❌ Does not replace your Freqtrade strategy logic
  • ❌ Does not optimise entry/exit signals
  • ❌ Does not require complex configuration
  • ❌ Does not lock you in (easy to remove - just delete a few lines)

Table of Contents


Integration Example

Protect your Freqtrade strategy in 30 seconds. See exactly what to add to your existing strategy (green) vs what you already have (gray).

💡 See the interactive color-coded example on remora-ai.com for the best visual experience. The website shows the color-coded version that makes it crystal clear what to add.

Step 0: Set your API key

Before running your strategy, set the environment variable:

export REMORA_API_KEY="your-api-key"

Get your free API key at remora-ai.com/signup.php

Note: You can use Remora without an API key (60 requests/minute), but registration gives you 300 requests/minute.

Step 1: Add Remora to your strategy

The code below shows what to add (marked with # REMORA: comments) vs your existing code:

class MyStrategy(IStrategy):
    # Your existing populate_entry_trend method:
    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        pair = metadata['pair']

        # Your existing entry conditions...
        # dataframe.loc[:, 'enter_long'] = 1  # example existing logic

        # REMORA: Add this check before return
        if not self.confirm_trade_entry(pair):
            dataframe.loc[:, 'enter_long'] = 0  # REMORA: Skip high-risk trades

        return dataframe  # Your existing return statement

    # REMORA: Add this new method
    def confirm_trade_entry(self, pair: str, **kwargs) -> bool:
        import os
        import requests
        api_key = os.getenv("REMORA_API_KEY")
        headers = {"Authorization": f"Bearer {api_key}"} if api_key else {}

        try:
            r = requests.get(
                "https://remora-ai.com/api/v1/risk",
                params={"pair": pair},
                headers=headers,
                timeout=2.0
            )
            return r.json().get("safe_to_trade", True)  # REMORA: Block entry if market is high-risk
        except Exception:
            return True  # REMORA: Fail-open

Instructions:

  1. Inside your existing populate_entry_trend(), insert the Remora check (marked with # REMORA:) just before return dataframe
  2. Add the confirm_trade_entry() method at the same indentation level as your other strategy methods
  3. Everything else in your strategy stays unchanged

That's it. No extra dependencies, no plugins, no cloning a repo.

Your strategy will skip risky entries automatically. If Remora is unavailable, trades proceed normally (fail-open by design).

Removing Remora is as simple as deleting these lines. No lock-in, fully transparent.


Optional: Example Strategies

Complete Examples

Advanced Tools


Advanced Users (Free Tier)

Features

  • Structured API access - Use remora.client for risk_score, regime, and reasoning
  • Custom thresholds - Adjust risk sensitivity in your own code
  • Indicator integration - Combine Remora with technical indicators
  • Pattern blocking - Block only specific patterns during high-risk regimes
  • Multi-timeframe context - Logging and advanced analysis

Example

from remora.client import RemoraClient

client = RemoraClient()
ctx = client.get_context("BTC/USDT")

if ctx["risk_score"] > 0.7:
    dataframe.loc[:, 'enter_long'] = 0

See examples/advanced_risk_filter_strategy.py for full examples.

Note: Advanced users using remora.client may want to check requirements-advanced.txt for optional dependencies. The simple snippet integration requires no additional dependencies.

Coming soon: Save your preferences, even higher rate limits, and per-user settings/preferences tied to your API key.


Want Proof?

Backtest Results

6 years of data, 4 strategies, 20 tests - See the Remora Backtests Repository for full details.

Metric Improvement
Profit +1.54%
Drawdown -1.55%
Trades Filtered 4.3% (increases to 16-19% during bear markets)
Success Rate 90% (18 out of 20 tests improved)

Key Findings:

  • Strongest impact during bear markets - 2022 saw 16-19% filtering during crashes
  • Adaptive filtering - More trades blocked when market conditions worsen
  • Smoother equity curves - Fewer losing entries, better risk-adjusted performance

Detailed Analysis: See the blog post for complete analysis, financial impact, and methodology.


Who This Is For

Level What to do
Beginners Add the snippet - start blocking risky entries instantly
Intermediate Use advanced_risk_filter_strategy.py - log risk, adjust sizing
Advanced Full API + custom weighting - regime-aware optimisation

Why Freqtrade Users Should Care

  • Reduced Drawdowns: Avoid trading during high-risk market conditions
  • Improved Risk-Adjusted Performance: Better Sharpe and Sortino ratios
  • Transparency: See exactly why trades were blocked
  • Fail-Safe: If Remora is unavailable, trades proceed normally (fail-open)
  • Easy Integration: Simple API call, not a plugin
  • Easy to Remove: Just delete a few lines if you want to disable it

Resources & Links

Remora Website

Blog Post

GitHub Repositories

Freqtrade

  • Freqtrade - Open-source cryptocurrency trading bot

Contributing & Feedback

PRs, issues, and feature requests welcome!

Questions? remora-ai.com


About

Add real-time market risk filtering to Freqtrade strategies. Block high-risk trades in seconds with a simple snippet - no dependencies required.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages