File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ public struct SwiftTraderOrderInput {
14
14
15
15
public let exchange : SwiftTraderExchange
16
16
public let ticker : String
17
+ public let contractSymbol : String
17
18
public let entryPrice : Double
18
19
public let currentPrice : Double
19
20
public let profitPercentage : Double
@@ -23,12 +24,14 @@ public struct SwiftTraderOrderInput {
23
24
24
25
public init ( exchange: SwiftTraderExchange ,
25
26
ticker: String ,
27
+ contractSymbol: String ,
26
28
entryPrice: Double ,
27
29
currentPrice: Double ,
28
30
profitPercentage: Double ,
29
31
offset: Double ) {
30
32
self . exchange = exchange
31
33
self . ticker = ticker
34
+ self . contractSymbol = contractSymbol
32
35
self . entryPrice = entryPrice
33
36
self . currentPrice = currentPrice
34
37
self . profitPercentage = profitPercentage
Original file line number Diff line number Diff line change @@ -18,12 +18,13 @@ public extension SwiftTrader {
18
18
let targetPercentage : Double = ( input. profitPercentage / 100 ) - ( input. offset / 100 )
19
19
let priceIncrement : Double = input. entryPrice * targetPercentage
20
20
21
+ #warning("TODO: round up?")
21
22
// Why Int? From a Kucoin response: "The parameter shall be a multiple of 1."
22
23
let targetPrice = Int ( input. entryPrice + priceIncrement)
23
24
let targetPriceString = String ( targetPrice)
24
25
25
26
return KucoinOrderParameters (
26
- symbol: input. ticker ,
27
+ symbol: input. contractSymbol ,
27
28
side: . sell,
28
29
type: . limit,
29
30
stop: . down,
You can’t perform that action at this time.
0 commit comments