spectredeath/em-cubed/falling-risk-pyramid

Claude Code and agent skill by spectredeath/em-cubed

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Falling risk pyramid for stratified risk classification using nested threshold rules and decision boundaries.

Install

npx vskill@latest install spectredeath/em-cubed/falling-risk-pyramid

SKILL.md

The same SKILL.md was published earlier as spectredeath/em-cubed/falling-risk-pyramid.

Purpose

Computes position sizes using a falling-risk pyramid model where risk decreases as price moves favorably.

Description

Implements dynamic position scaling based on distance from entry. As price moves favorably, position size increases while risk per unit decreases. Uses SQLite to track open positions and Python to compute the risk-adjusted scaling levels.

Implementation

Python
python
def compute_pyramid(entry_price, market_price, account_risk, max_pyramid_levels):
price_distance = abs(market_price - entry_price)
if price_distance < 0.001 * entry_price:
price_distance = 0.001 * entry_price
current_level = min(int(price_distance / (0.005 * entry_price)), max_pyramid_levels - 1)
base_units = account_risk / (0.01 * entry_price)
positions = []
for level in range(current_level + 1):
scale_factor = 1.0 + 0.5 * level
units = int(base_units * scale_factor)
stop_distance = max_pyramid_levels - level
risk_per_unit = account_risk / (units * stop_distance) if units > 0 else account_risk
positions.append({
"level": level,
"units": units,
"entry": entry_price * (1 + 0.005 * level) if market_price > entry_price else entry_price * (1 - 0.005 * level),
"stop_loss": entry_price * (1 - 0.01 * (max_pyramid_levels - level)) if market_price > entry_price else entry_price * (1 + 0.01 * (max_pyramid_levels - level)),
"risk_per_unit": risk_per_unit,
"total_risk": units * risk_per_unit
})
return {
"current_level": current_level,
"positions": positions,
"total_units": sum(p["units"] for p in positions),
"remaining_capacity": max_pyramid_levels - current_level,
"status": "success"
}
compute_pyramid(entry_price, market_price, account_risk, 5)
SQLite
sql
CREATE TABLE IF NOT EXISTS pyramid_positions (
session_id TEXT,
level INTEGER,
units INTEGER,
entry_price REAL,
stop_loss REAL,
risk_per_unit REAL,
total_risk REAL,
created_at INTEGER DEFAULT (strftime('%s', 'now'))
);
INSERT INTO pyramid_positions (session_id, level, units, entry_price, stop_loss, risk_per_unit, total_risk)
VALUES (:session_id, :level, :units, :entry_price, :stop_loss, :risk_per_unit, :total_risk);
SELECT level, units, entry_price, stop_loss, total_risk
FROM pyramid_positions
WHERE session_id = :session_id
ORDER BY level ASC;

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/spectredeath/em-cubed/falling-risk-pyramid/badge)](https://verified-skill.com/skills/spectredeath/em-cubed/falling-risk-pyramid)

Something wrong with this skill or its page? Tell us.