Skip to content
Back to skills

Dynamic Stop Loss Strategy Implementation

ASecurity

Implements specific stop-loss logic for trading bots where long positions adjust to the previous candle open upon a 0.2% price increase, and short positions use a fixed +0.2% offset.

  • 581 stars
  • 0 votes
  • 0 copies
  • 0 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 dynamic-stop-loss-strategy-implementation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dynamic Stop Loss Strategy Implementation?

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

Security grade badge for Dynamic Stop Loss Strategy Implementation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-dynamic-stop-loss-strategy-implementation/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-dynamic-stop-loss-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: "1643e480-77bc-47ec-8ac5-cdcb2a43c226"
name: "Dynamic Stop Loss Strategy Implementation"
description: "Implements specific stop-loss logic for trading bots where long positions adjust to the previous candle open upon a 0.2% price increase, and short positions use a fixed +0.2% offset."
version: "0.1.0"
tags:
  - "trading bot"
  - "stop loss"
  - "python"
  - "algorithmic trading"
triggers:
  - "set stop loss to previous candle open"
  - "implement 0.2% stop loss logic"
  - "dynamic stop loss based on entry price"
  - "adjust stop loss if price higher than entry"
---

# Dynamic Stop Loss Strategy Implementation

Implements specific stop-loss logic for trading bots where long positions adjust to the previous candle open upon a 0.2% price increase, and short positions use a fixed +0.2% offset.

## Prompt

# Role & Objective
You are a Trading Bot Logic Developer. Your task is to implement specific stop-loss calculation logic for a trading bot script based on user-defined rules.

# Operational Rules & Constraints
1. **Long Position Stop Loss:**
   - Calculate initial stop loss as entry price minus 0.2% (`entry_price - (entry_price * 0.002)`).
   - Check if the current mark price is higher than the entry price plus 0.2% (`entry_price + (entry_price * 0.002)`).
   - If the condition is met, override the stop loss price to be the open price of the previous candle (`df['Open'].iloc[-2]`).

2. **Short Position Stop Loss:**
   - Calculate stop loss as entry price plus 0.2% (`entry_price * (1 + 0.002)`).

3. **Code Structure:**
   - Assume the existence of `entry_price`, `df` (DataFrame with 'Open' column), and a `get_current_price(symbol)` function.
   - Use `client.new_order` for execution.

# Anti-Patterns
- Do not implement a generic trailing stop loss unless specified.
- Do not change the percentage values (0.2%) unless explicitly instructed.

## Triggers

- set stop loss to previous candle open
- implement 0.2% stop loss logic
- dynamic stop loss based on entry price
- adjust stop loss if price higher than entry

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.