Skip to content

Commit 24fbc6f

Browse files
author
Fernando Fernandes
committed
Refactor
1 parent 27e6556 commit 24fbc6f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Sources/SwiftTrader/Model/SwiftTraderOrderInput.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public struct SwiftTraderStopLimitOrderInput {
1212

1313
// MARK: - Properties
1414

15-
public let clean: Bool
15+
public let cancelStopOrders: Bool
1616
public let contractSymbol: String
1717
public let currentPrice: Double
1818
public let entryPrice: Double
@@ -28,8 +28,8 @@ public struct SwiftTraderStopLimitOrderInput {
2828
/// Creates a `SwiftTraderOrderInput` instance.
2929
///
3030
/// - Parameters:
31-
/// - clean: When `true`, all the untriggered stop orders for the `contractSymbol` will be cancelled before placing a new one.
32-
/// Cleaning is done via `SwiftTrader.kucoinFuturesCancelStopOrders(symbol:)`. In case that fails, the execution continues
31+
/// - cancelStopOrders: When `true`, all the untriggered stop orders for the `contractSymbol` will be cancelled before placing a new one.
32+
/// Cancelling is done via `SwiftTrader.kucoinFuturesCancelStopOrders(symbol:)`. In case that fails, the execution continues
3333
/// and a new order will be placed regardless.
3434
/// - contractSymbol: E.g.: XBTCUSDTM
3535
/// - currentPrice: The current price of the asset.
@@ -44,7 +44,7 @@ public struct SwiftTraderStopLimitOrderInput {
4444
/// - profitPercentage: The percentage of the profit at this point, e.g.: "1.5", "0.67".
4545
/// - ticker: E.g.: BTCUSDT
4646
/// - tickerSize: E.g.: "1", "0.05", "0.00001"
47-
public init(clean: Bool,
47+
public init(cancelStopOrders: Bool,
4848
contractSymbol: String,
4949
currentPrice: Double,
5050
entryPrice: Double,
@@ -54,7 +54,7 @@ public struct SwiftTraderStopLimitOrderInput {
5454
profitPercentage: Double,
5555
ticker: String,
5656
tickerSize: String) {
57-
self.clean = clean
57+
self.cancelStopOrders = cancelStopOrders
5858
self.contractSymbol = contractSymbol
5959
self.currentPrice = currentPrice
6060
self.entryPrice = entryPrice

Sources/SwiftTrader/SwiftTrader.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public extension SwiftTrader {
9999
do {
100100
let orderParameters = try createStopLimitOrderParameters(for: orderInput)
101101

102-
if orderInput.clean {
102+
if orderInput.cancelStopOrders {
103103
do {
104104
try await kucoinFuturesCancelStopOrders(symbol: orderInput.contractSymbol)
105105
} catch {

0 commit comments

Comments
 (0)