Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop Loss implementation #93

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from
Draft

Stop Loss implementation #93

wants to merge 7 commits into from

Conversation

bludnic
Copy link
Member

@bludnic bludnic commented Jan 5, 2025

Implemented Stop Loss on the bot side. A native stop loss will be added later for exchanges that support it.

Usage

Stop-Limit

const trade = yield useSmartTrade({
  entry: { type: "Market" },
  tp: {
    type: "Limit",
    price: 100_000,
  },
  sl: {
    type: "Limit",
    stopPrice: 95000, // <-- SL triggered at this price
    price: 94500, // Limit order price
  },
  quantity: 0.001,
});

Stop-Market

const trade = yield useSmartTrade({
  entry: { type: "Market" },
  tp: {
    type: "Limit",
    price: 100_000,
  },
  sl: {
    type: "Market",
    stopPrice: 95000, // <-- SL triggered at this price. Market order will be placed.
  },
  quantity: 0.001,
});

@bludnic bludnic self-assigned this Jan 5, 2025
@bludnic bludnic marked this pull request as draft January 5, 2025 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant