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
6804ef3a
Commit
6804ef3a
authored
Dec 20, 2018
by
zihan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug调整
parent
a418d46b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
strategy3.js
strategy3.js
+8
-3
test_kucoin.js
test_kucoin.js
+2
-2
No files found.
strategy3.js
View file @
6804ef3a
...
...
@@ -50,17 +50,22 @@ class Strategy3 {
let
amount
=
result
[
7
];
let
returnAmount
=
result
[
8
];
// console.log({buyRemark, sellRemark, returnRemark});
const
sellDelay
=
endTime
-
this
.
collector
.
getSymbolEventTime
(
sellSymbol
);
if
(
this
.
_logDelay
()){
const
buySymbol
=
this
.
collector
.
getSymbol
(
baseCurrency1
,
midCurrency
);
const
sellSymbol
=
this
.
collector
.
getSymbol
(
midCurrency
,
baseCurrency2
);
const
buyDelay
=
endTime
-
this
.
collector
.
getSymbolEventTime
(
buySymbol
);
const
sellDelay
=
endTime
-
this
.
collector
.
getSymbolEventTime
(
sellSymbol
);
console
.
log
(
'买入交易对延迟:'
+
buyDelay
+
" 卖出交易对延迟:"
+
sellDelay
);
if
(
buyDelay
>
5000
||
sellDelay
>
5000
){
// if(buyDelay> 5000 || sellDelay > 5000){
// console.log('延时过大,放弃该轮交易');
// return false;
// }
}
if
(
sellDelay
>
5000
){
console
.
log
(
'延时过大,放弃该轮交易'
);
return
false
;
}
}
const
service
=
this
.
service
;
let
savedRecord
=
null
;
const
finishedOrders
=
[];
...
...
test_kucoin.js
View file @
6804ef3a
...
...
@@ -43,7 +43,7 @@ function testCollector(){
// const strategy3 = new BiboxStrategy3(collector);
// strategy3.run();
}
testCollector
();
//
testCollector();
function
printCurrency
(){
const
currentArray
=
[,
'ETH'
,
'BTC'
,
'LTC'
,
'BCH'
,
'USDT'
,
'USD'
,
'RMB'
,
"RCN"
,
"WINGS"
,
"TRX"
,
"LEND"
,
"CMT"
,
"POWR"
,
"HSR"
,
"GAS"
,
"RDN"
,
"TNT"
,
"OAX"
...
...
@@ -121,7 +121,7 @@ function printCurrency(){
}
})
}
//
printCurrency()
printCurrency
()
function
testOrder
(){
const
order
=
new
Order
();
...
...
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