Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
ai
Commits
79e7179b
Commit
79e7179b
authored
Apr 14, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pu
parent
3a89ebe7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
test_json.js
test_json.js
+2
-2
uniq2.js
uniq2.js
+24
-1
No files found.
test_json.js
View file @
79e7179b
let
_
=
require
(
'
lodash
'
)
let
_
=
require
(
'
lodash
'
)
let
arr
=
[
2
,
3
,
5
,
1
,
2
,
2
]
let
arr
=
[
2
,
3
,
5
,
1
,
2
,
2
]
let
t
=
'
last.json-220217123102_O1_BNC_ETHUSDT_Lp919_1ETH8.csv
'
console
.
log
(
_
.
orderBy
(
arr
))
console
.
log
(
t
.
split
(
'
-
'
))
\ No newline at end of file
\ No newline at end of file
uniq2.js
View file @
79e7179b
...
@@ -28,6 +28,7 @@ async function run() {
...
@@ -28,6 +28,7 @@ async function run() {
total
.
push
(
config
[
j
].
total
)
total
.
push
(
config
[
j
].
total
)
let
dateString
=
config
[
j
].
dateString
.
split
(
'
_
'
)
let
dateString
=
config
[
j
].
dateString
.
split
(
'
_
'
)
let
runUpString
=
config
[
j
].
runupString
.
split
(
'
_
'
)
let
runUpString
=
config
[
j
].
runupString
.
split
(
'
_
'
)
let
platfrom
=
config
[
j
].
platform
.
split
(
'
-
'
)[
1
]
let
arrDate
=
[]
let
arrDate
=
[]
for
(
let
z
=
0
;
z
<
dateString
.
length
-
1
;
z
++
)
for
(
let
z
=
0
;
z
<
dateString
.
length
-
1
;
z
++
)
...
@@ -52,6 +53,7 @@ async function run() {
...
@@ -52,6 +53,7 @@ async function run() {
addShortLong
(
config
[
j
].
total
,
countOfshort
,
countOfLong
)
addShortLong
(
config
[
j
].
total
,
countOfshort
,
countOfLong
)
addPoftrade
(
config
[
j
].
total
,
config
[
j
].
pftrade
)
addPoftrade
(
config
[
j
].
total
,
config
[
j
].
pftrade
)
addRunup
(
config
[
j
].
total
,
arrRunup
[
0
],
arrRunup
[
arrRunup
.
length
-
1
])
addRunup
(
config
[
j
].
total
,
arrRunup
[
0
],
arrRunup
[
arrRunup
.
length
-
1
])
addPlatform
(
config
[
j
].
total
,
platfrom
)
}
}
...
@@ -103,6 +105,15 @@ async function run() {
...
@@ -103,6 +105,15 @@ async function run() {
}
}
}
}
for
(
let
i
=
0
;
i
<
adder
.
length
;
i
++
)
{
for
(
let
z
=
i
+
1
;
z
<
adder
.
length
;
z
++
)
{
let
platfrom
=
adder
[
z
].
platfrom
for
(
let
l
=
0
;
l
<
platfrom
.
length
;
l
++
)
addPlatform
(
adder
[
i
].
total
,
platfrom
[
l
])
}
}
var
endTime
=
performance
.
now
()
var
endTime
=
performance
.
now
()
console
.
log
(
`Call to doSomething took
${
endTime
-
startTime
}
milliseconds`
)
console
.
log
(
`Call to doSomething took
${
endTime
-
startTime
}
milliseconds`
)
...
@@ -116,7 +127,10 @@ async function run() {
...
@@ -116,7 +127,10 @@ async function run() {
adder
[
i
].
type
=
_
.
uniq
(
adder
[
i
].
type
)
adder
[
i
].
type
=
_
.
uniq
(
adder
[
i
].
type
)
adder
[
i
].
type
=
_
.
orderBy
(
adder
[
i
].
type
)
adder
[
i
].
type
=
_
.
orderBy
(
adder
[
i
].
type
)
adder
[
i
].
countOfType
=
adder
[
i
].
type
.
length
adder
[
i
].
countOfType
=
adder
[
i
].
type
.
length
adder
[
i
].
platfrom
=
_
.
uniq
(
adder
[
i
].
platfrom
)
adder
[
i
].
countOfPlatform
=
adder
[
i
].
platfrom
.
length
delete
adder
[
i
].
platfrom
adder
[
i
].
pfTrade
=
_
.
orderBy
(
adder
[
i
].
pfTrade
)
adder
[
i
].
pfTrade
=
_
.
orderBy
(
adder
[
i
].
pfTrade
)
let
temp
=
[]
let
temp
=
[]
...
@@ -183,7 +197,7 @@ function add(total, dates, type) {
...
@@ -183,7 +197,7 @@ function add(total, dates, type) {
if
(
found
)
if
(
found
)
return
return
adder
.
push
({
total
:
total
,
dates
:
dates
,
countDay
:
dates
.
length
,
type
:
[
type
],
pfTrade
:
[],
short
:
0
,
long
:
0
,
minRunup
:
100
,
maxRunup
:
0
})
adder
.
push
({
total
:
total
,
dates
:
dates
,
countDay
:
dates
.
length
,
type
:
[
type
],
pfTrade
:
[],
short
:
0
,
long
:
0
,
minRunup
:
100
,
maxRunup
:
0
,
platfrom
:[]
})
}
}
...
@@ -206,6 +220,15 @@ function addPoftrade(total, pfTrade) {
...
@@ -206,6 +220,15 @@ function addPoftrade(total, pfTrade) {
}
}
}
}
function
addPlatform
(
total
,
platform
)
{
for
(
let
i
=
0
;
i
<
adder
.
length
;
i
++
)
if
(
adder
[
i
].
total
===
total
)
{
adder
[
i
].
platfrom
.
push
(
platform
)
}
}
function
addRunup
(
total
,
minRunup
,
maxRunup
)
{
function
addRunup
(
total
,
minRunup
,
maxRunup
)
{
for
(
let
i
=
0
;
i
<
adder
.
length
;
i
++
)
for
(
let
i
=
0
;
i
<
adder
.
length
;
i
++
)
...
...
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