Skip to content

Configuration & Parameters

Leonardo Bitto edited this page Jan 6, 2026 · 2 revisions

Configuration Guide

Petunia uses a centralized JSON configuration file located at config/strategies.json. This file controls the active strategy, risk rules, and broker fee simulation.

File Structure (strategies.json)

{
    "active_strategy": "RSI",
    "risk_params": {
        "risk_per_trade": 0.02,
        "stop_atr_multiplier": 2.0
    },
    "fees_config": {
        "fixed_euro": 2.0,
        "percentage": 0.0005
    },
    "strategies_params": {
        "RSI": { ... },
        "EMA": { ... }
    }
}

Parameters Dictionary

1. General Settings

  • active_strategy: The exact class name key (e.g., "RSI", "EMA") that the WeeklyRun will execute.

2. Risk Management (risk_params)

  • risk_per_trade (float): The portion of Total Equity to risk on a single trade.

  • Example: 0.02 = 2%. If Equity is €10,000, max risk is €200.

  • stop_atr_multiplier (float): Determines the Stop Loss distance based on volatility.

  • Example: 2.0. If ATR is 5€, Stop Loss is placed 10€ below entry.

3. Fee Structure (fees_config)

Used in Backtesting (to calculate Net ROI) and Weekly Run (to update cash).

  • fixed_euro (float): Flat fee per order execution.
  • percentage (float): Variable fee based on order value. 0.0005 = 0.05%.

4. Strategy Parameters (strategies_params)

Parameters specific to each algorithm.

  • RSI: rsi_period, rsi_lower (Buy Zone), rsi_upper (Sell Zone).
  • EMA: short_window (Fast MA), long_window (Slow MA).

Clone this wiki locally