Loading…
Public trading strategy

Oil spike threatens inflation comeback — long defense stocks as safe haven plays

Created

Thesis

Oil prices are spiking due to the breakdown of the Iran ceasefire, and experts warn this will trigger higher inflation, keeping the Federal Reserve hawkish. Simultaneously, defense stocks like Lockheed Martin and Northrop Grumman are already rising as the threat of wider military conflict grows. When oil spikes on military action, defense contractors provide a hedge because they benefit directly from government military spending, which increases during exactly these types of geopolitical crises.

Strategy approach

Build a long-only momentum strategy on LMT and NOC using daily candles. Entry: buy when front-month WTI crude oil futures (CL1) gain >3% in a single session AND LMT or NOC close up >1.5% on the same day. Exit: take profit after a 10-day hold or if oil drops 4% from its entry level. Use a 5% stop loss.

Markets and timeframes

Entry and exit at a glance

These are the named rules in the shared configuration. Review the full conditions below before using a strategy.

  • Entry: Oil Spike + Defense Momentum Long (LMT@1d) (3 conditions)
  • Entry: Oil Spike + Defense Momentum Long (NOC@1d) (3 conditions)
  • Exit: Oil Reversal Exit (USO@1d) (1 condition)
  • Exit: Time Stop After 10 Days (1 condition)
  • Exit: Stop Loss at 5.0% (1 condition)
  • Exit: Take Profit at 5.0% (1 condition)

Shared strategy rules

Rule configuration

{
  "data_dependencies": [
    {
      "symbol": "STOCK:LMT",
      "timeframe": "1d"
    },
    {
      "symbol": "STOCK:NOC",
      "timeframe": "1d"
    },
    {
      "symbol": "STOCK:USO",
      "timeframe": "1d"
    }
  ],
  "entry_rules": [
    {
      "conditions": [
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:USO",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "roc",
              "period": 1
            },
            "type": "indicator"
          },
          "operator": "greater_than",
          "right": {
            "type": "constant",
            "value": 3
          }
        },
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:LMT",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "roc",
              "period": 1
            },
            "type": "indicator"
          },
          "operator": "greater_than",
          "right": {
            "type": "constant",
            "value": 1.5
          }
        },
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:LMT",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "ema",
              "period": 21
            },
            "type": "indicator"
          },
          "operator": "greater_than",
          "right": {
            "chart_ref": {
              "symbol": "STOCK:LMT",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "ema",
              "period": 63
            },
            "type": "indicator"
          }
        }
      ],
      "direction": "long",
      "enabled": true,
      "id": "entry_1",
      "name": "Oil Spike + Defense Momentum Long (LMT@1d)",
      "priority": 1,
      "trade_symbol": "STOCK:LMT"
    },
    {
      "conditions": [
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:USO",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "roc",
              "period": 1
            },
            "type": "indicator"
          },
          "operator": "greater_than",
          "right": {
            "type": "constant",
            "value": 3
          }
        },
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:NOC",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "roc",
              "period": 1
            },
            "type": "indicator"
          },
          "operator": "greater_than",
          "right": {
            "type": "constant",
            "value": 1.5
          }
        },
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:NOC",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "ema",
              "period": 21
            },
            "type": "indicator"
          },
          "operator": "greater_than",
          "right": {
            "chart_ref": {
              "symbol": "STOCK:NOC",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "ema",
              "period": 63
            },
            "type": "indicator"
          }
        }
      ],
      "direction": "long",
      "enabled": true,
      "id": "entry_2",
      "name": "Oil Spike + Defense Momentum Long (NOC@1d)",
      "priority": 2,
      "trade_symbol": "STOCK:NOC"
    }
  ],
  "exit_rules": [
    {
      "applies_to": "both",
      "conditions": [
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:USO",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "roc",
              "period": 1
            },
            "type": "indicator"
          },
          "operator": "less_than_or_equal",
          "right": {
            "type": "constant",
            "value": -4
          }
        }
      ],
      "enabled": true,
      "id": "exit_1",
      "name": "Oil Reversal Exit (USO@1d)",
      "priority": 1,
      "purpose": "signal",
      "target_symbol": "STOCK:LMT"
    },
    {
      "applies_to": "both",
      "conditions": [
        {
          "left": {
            "field": "holding_period_bars",
            "type": "position"
          },
          "operator": "greater_than_or_equal",
          "right": {
            "type": "constant",
            "value": 10
          }
        }
      ],
      "enabled": true,
      "id": "exit_2",
      "name": "Time Stop After 10 Days",
      "priority": 2,
      "purpose": "signal"
    },
    {
      "applies_to": "both",
      "conditions": [
        {
          "left": {
            "field": "unrealized_pnl_percent",
            "type": "position"
          },
          "operator": "less_than_or_equal",
          "right": {
            "type": "constant",
            "value": -5
          }
        }
      ],
      "enabled": true,
      "id": "exit_3",
      "name": "Stop Loss at 5.0%",
      "priority": 100,
      "purpose": "stop_loss"
    },
    {
      "applies_to": "both",
      "conditions": [
        {
          "left": {
            "field": "unrealized_pnl_percent",
            "type": "position"
          },
          "operator": "greater_than_or_equal",
          "right": {
            "type": "constant",
            "value": 4.993
          }
        }
      ],
      "enabled": true,
      "id": "exit_4",
      "name": "Take Profit at 5.0%",
      "priority": 100,
      "purpose": "take_profit"
    }
  ],
  "position_sizing": {
    "max_position_percent": 25,
    "method": {
      "risk_percent": 2.4965,
      "support_stop_rank": 2,
      "type": "fixed_risk"
    },
    "min_position_value": 100
  },
  "trigger_timeframe": "1d",
  "version": 2
}

Indicator configuration

{
  "indicators": [
    {
      "name": "roc",
      "period": 1
    },
    {
      "name": "roc",
      "period": 10
    },
    {
      "name": "ema",
      "period": 21
    },
    {
      "name": "atr",
      "period": 14
    }
  ]
}

Parsed strategy

{
  "data_dependencies": [
    {
      "symbol": "STOCK:LMT",
      "timeframe": "1d"
    },
    {
      "symbol": "STOCK:NOC",
      "timeframe": "1d"
    },
    {
      "symbol": "STOCK:USO",
      "timeframe": "1d"
    }
  ],
  "entry_rules": [
    {
      "conditions": [
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:USO",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "roc",
              "period": 1
            },
            "type": "indicator"
          },
          "operator": "greater_than",
          "right": {
            "type": "constant",
            "value": 3
          }
        },
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:LMT",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "roc",
              "period": 1
            },
            "type": "indicator"
          },
          "operator": "greater_than",
          "right": {
            "type": "constant",
            "value": 1.5
          }
        },
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:LMT",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "ema",
              "period": 21
            },
            "type": "indicator"
          },
          "operator": "greater_than",
          "right": {
            "chart_ref": {
              "symbol": "STOCK:LMT",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "ema",
              "period": 63
            },
            "type": "indicator"
          }
        }
      ],
      "direction": "long",
      "enabled": true,
      "id": "entry_1",
      "name": "Oil Spike + Defense Momentum Long (LMT@1d)",
      "priority": 1,
      "trade_symbol": "STOCK:LMT"
    },
    {
      "conditions": [
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:USO",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "roc",
              "period": 1
            },
            "type": "indicator"
          },
          "operator": "greater_than",
          "right": {
            "type": "constant",
            "value": 3
          }
        },
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:NOC",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "roc",
              "period": 1
            },
            "type": "indicator"
          },
          "operator": "greater_than",
          "right": {
            "type": "constant",
            "value": 1.5
          }
        },
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:NOC",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "ema",
              "period": 21
            },
            "type": "indicator"
          },
          "operator": "greater_than",
          "right": {
            "chart_ref": {
              "symbol": "STOCK:NOC",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "ema",
              "period": 63
            },
            "type": "indicator"
          }
        }
      ],
      "direction": "long",
      "enabled": true,
      "id": "entry_2",
      "name": "Oil Spike + Defense Momentum Long (NOC@1d)",
      "priority": 2,
      "trade_symbol": "STOCK:NOC"
    }
  ],
  "exit_rules": [
    {
      "applies_to": "both",
      "conditions": [
        {
          "left": {
            "chart_ref": {
              "symbol": "STOCK:USO",
              "timeframe": "1d"
            },
            "indicator": {
              "name": "roc",
              "period": 1
            },
            "type": "indicator"
          },
          "operator": "less_than_or_equal",
          "right": {
            "type": "constant",
            "value": -4
          }
        }
      ],
      "enabled": true,
      "id": "exit_1",
      "name": "Oil Reversal Exit (USO@1d)",
      "priority": 1,
      "purpose": "signal",
      "target_symbol": "STOCK:LMT"
    },
    {
      "applies_to": "both",
      "conditions": [
        {
          "left": {
            "field": "holding_period_bars",
            "type": "position"
          },
          "operator": "greater_than_or_equal",
          "right": {
            "type": "constant",
            "value": 10
          }
        }
      ],
      "enabled": true,
      "id": "exit_2",
      "name": "Time Stop After 10 Days",
      "priority": 2,
      "purpose": "signal"
    },
    {
      "applies_to": "both",
      "conditions": [
        {
          "left": {
            "field": "unrealized_pnl_percent",
            "type": "position"
          },
          "operator": "less_than_or_equal",
          "right": {
            "type": "constant",
            "value": -5
          }
        }
      ],
      "enabled": true,
      "id": "exit_3",
      "name": "Stop Loss at 5.0%",
      "priority": 100,
      "purpose": "stop_loss"
    },
    {
      "applies_to": "both",
      "conditions": [
        {
          "left": {
            "field": "unrealized_pnl_percent",
            "type": "position"
          },
          "operator": "greater_than_or_equal",
          "right": {
            "type": "constant",
            "value": 4.993
          }
        }
      ],
      "enabled": true,
      "id": "exit_4",
      "name": "Take Profit at 5.0%",
      "priority": 100,
      "purpose": "take_profit"
    }
  ],
  "position_sizing": {
    "max_position_percent": 25,
    "method": {
      "risk_percent": 2.4965,
      "support_stop_rank": 2,
      "type": "fixed_risk"
    },
    "min_position_value": 100
  },
  "trigger_timeframe": "1d",
  "version": 2
}

Strategy instructions

Trading agent generated from recommendation idea 'Oil spike threatens inflation comeback — long defense stocks as safe haven plays'. Thesis: Oil prices are spiking due to the breakdown of the Iran ceasefire, and experts warn this will trigger higher inflation, keeping the Federal Reserve hawkish. Simultaneously, defense stocks like Lockheed Martin and Northrop Grumman are already rising as the threat of wider military conflict grows. When oil spikes on military action, defense contractors provide a hedge because they benefit directly from government military spending, which increases during exactly these types of geopolitical crises.

Performance

No trade count, win rate, or realized P&L figures are provided in this public preview. The thesis and shared rules do not establish a performance record.

What this public preview can establish

  • The thesis and strategy approach describe a market view. They do not show whether an entry or exit condition is currently met.
  • Technical strategy fields are shared above. Inspect the actual conditions and check when they were evaluated before relying on them.
  • No trade count, win rate, or P&L figure is published in this preview. It cannot establish a performance record.

Explore

How CommonQuant researches and tests strategies · Public paper-trading record and its limits · Discover public strategies