Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kucoin
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rongjun
kucoin
Commits
6e81711e
Commit
6e81711e
authored
Sep 22, 2018
by
rongjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
434b44e2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
kucoinStrategy3.js
kucoinStrategy3.js
+2
-1
order_kucoin.js
order_kucoin.js
+5
-8
No files found.
kucoinStrategy3.js
View file @
6e81711e
...
...
@@ -84,12 +84,13 @@ class BiboxStrategy3 extends Strategy3 {
if
(
order
.
executedQty
===
order
.
origQty
)
{
console
.
log
(
"买入全部成交"
);
createdBuyOrder
=
true
;
amount
=
collector
.
processAmount
(
midCurrency
,
baseCurrency2
,
parseFloat
(
order
.
executedQty
*
0.999
));
sellOrder
();
returnOrder
();
}
else
if
(
parseFloat
(
order
.
executedQty
)
>
0
)
{
returnAmount
=
parseFloat
(
returnAmount
)
*
parseFloat
(
order
.
executedQty
)
/
parseFloat
(
amount
);
returnAmount
=
collector
.
processAmount
(
baseCurrency2
,
baseCurrency1
,
returnAmount
);
amount
=
collector
.
processAmount
(
midCurrency
,
baseCurrency2
,
parseFloat
(
order
.
executedQty
));
amount
=
collector
.
processAmount
(
midCurrency
,
baseCurrency2
,
parseFloat
(
order
.
executedQty
*
0.999
));
console
.
log
(
`买入部分成交
${
order
.
executedQty
}
回归量调整为
${
returnAmount
}
`
);
order
.
remark
=
"部分成交@amount "
+
order
.
executedQty
+
";"
;
createdBuyOrder
=
true
;
...
...
order_kucoin.js
View file @
6e81711e
...
...
@@ -22,18 +22,15 @@ function returnFakeOrder(symbol, price, amount) {
function
convertToRecordOrder
(
order
)
{
let
status
=
constants
.
OrderStatusNew
;
if
(
!
order
.
isActive
){
status
=
constants
.
OrderStatusCanceled
;
}
else
{
if
(
order
.
pendingAmount
===
0
){
status
=
constants
.
OrderStatusFilled
;
}
// if(order.dealAmount === 0){
// status = constants.OrderStatusNew;
// }
if
(
order
.
dealAmount
>
0
&&
order
.
pendingAmount
>
0
){
}
else
{
if
(
order
.
dealAmount
>
0
){
status
=
constants
.
OrderStatusPartiallyFilled
;
}
if
(
!
order
.
isActive
&&
order
.
dealAmount
===
0
){
status
=
constants
.
OrderStatusCanceled
;
}
}
return
{
orderId
:
order
.
orderOid
+
''
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment