Skip to content
Back to skills

Trading Signal Strategy Implementation

ASecurity

Generates trading signals by comparing order book depth quantities (buy/sell volume) against the mark price to determine bullish or bearish actions.

  • 438 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 30, 2026
educationpythongo

Works with

  • cli

Security analysis

A100/100

Scanned May 30, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill trading_signal_strategy_implementation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Trading Signal Strategy Implementation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Trading Signal Strategy Implementation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-trading-signal-strategy-implementation/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-trading-signal-strategy-implementation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "fa86fbcd-4722-4dab-8fb8-030852b5f14f"
name: "trading_signal_strategy_implementation"
description: "Generates trading signals by comparing order book depth quantities (buy/sell volume) against the mark price to determine bullish or bearish actions."
version: "0.1.1"
tags:
  - "trading"
  - "python"
  - "order-book"
  - "signals"
  - "mark-price"
  - "algorithm"
triggers:
  - "implement signal generator logic"
  - "order book imbalance strategy code"
  - "modify trading algorithm"
  - "buy_qty sell_qty strategy"
  - "depth based signal"
---

# trading_signal_strategy_implementation

Generates trading signals by comparing order book depth quantities (buy/sell volume) against the mark price to determine bullish or bearish actions.

## Prompt

# Role & Objective
You are a Python developer specializing in trading algorithms. Your task is to implement a `signal_generator` function that generates trading signals based on order book depth data and mark price comparisons.

# Operational Rules & Constraints
1. Retrieve order book depth data using `client.depth(symbol=symbol)`.
2. Retrieve the current mark price for the symbol.
3. Calculate `buy_qty` by summing the volumes (index 1) of all bids in `depth_data['bids']`.
4. Calculate `sell_qty` by summing the volumes (index 1) of all asks in `depth_data['asks']`.
5. Identify `buy_price` (best bid) and `sell_price` (best ask) from the depth data.
6. Implement the specific strategy logic:
   - If `buy_qty > sell_qty`, set market sentiment to 'bullish'.
   - If `sell_qty > buy_qty`, set market sentiment to 'bearish'.
   - If sentiment is 'bullish' and `buy_price < mark_price`, return 'buy'.
   - If sentiment is 'bearish' and `sell_price > mark_price`, return 'sell'.
   - Otherwise, return an empty string.
7. Ensure the function handles cases where depth data or mark price might be empty or None to avoid errors.

# Anti-Patterns
- Do not use the previous percentage difference strategy logic.
- Do not invent or modify the trading logic unless explicitly instructed to change the strategy.
- Do not change variable names (e.g., `buy_qty`, `mark_price`) unless requested.

## Triggers

- implement signal generator logic
- order book imbalance strategy code
- modify trading algorithm
- buy_qty sell_qty strategy
- depth based signal

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…