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
97bdc299
Commit
97bdc299
authored
Jun 18, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pull
parent
9624d110
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
+28
-3
torobche.js
torobche.js
+28
-3
No files found.
torobche.js
View file @
97bdc299
...
@@ -6,6 +6,7 @@ let pair = 'BNB'
...
@@ -6,6 +6,7 @@ let pair = 'BNB'
let
res
let
res
let
arr
=
[]
let
arr
=
[]
let
lastBalance
=
10000
let
lastBalance
=
10000
let
size
=
100
let
balance
=
lastBalance
let
balance
=
lastBalance
init
()
init
()
...
@@ -16,6 +17,13 @@ let com
...
@@ -16,6 +17,13 @@ let com
//drawDownString
//drawDownString
async
function
init
()
{
async
function
init
()
{
try
{
await
fs
.
mkdirSync
(
'
torob
'
)
}
catch
(
e
)
{
}
com
=
await
fs
.
readFileSync
(
'
t.json
'
,
'
utf8
'
);
com
=
await
fs
.
readFileSync
(
'
t.json
'
,
'
utf8
'
);
let
bad
=
await
fs
.
readFileSync
(
'
bad.txt
'
,
'
utf8
'
);
let
bad
=
await
fs
.
readFileSync
(
'
bad.txt
'
,
'
utf8
'
);
bad
=
JSON
.
parse
(
bad
)
bad
=
JSON
.
parse
(
bad
)
...
@@ -33,7 +41,7 @@ run()
...
@@ -33,7 +41,7 @@ run()
async
function
lastCheck
(
param1
,
param2
,
param3
)
{
async
function
lastCheck
(
param1
,
param2
,
param3
,
arr5
)
{
let
bad
=
await
fs
.
readFileSync
(
'
bad.txt
'
,
'
utf8
'
);
let
bad
=
await
fs
.
readFileSync
(
'
bad.txt
'
,
'
utf8
'
);
bad
=
JSON
.
parse
(
bad
)
bad
=
JSON
.
parse
(
bad
)
...
@@ -44,6 +52,8 @@ async function lastCheck(param1,param2,param3) {
...
@@ -44,6 +52,8 @@ async function lastCheck(param1,param2,param3) {
{
{
let
z
=
{
maxReserve
:
param1
,
balance
:
param2
,
bad
:
param3
}
let
z
=
{
maxReserve
:
param1
,
balance
:
param2
,
bad
:
param3
}
await
createfileADV
(
JSON
.
stringify
(
z
))
await
createfileADV
(
JSON
.
stringify
(
z
))
await
createfileTorob
(
param3
,
JSON
.
stringify
(
arr5
,
null
,
2
))
}
}
...
@@ -64,7 +74,7 @@ async function run()
...
@@ -64,7 +74,7 @@ async function run()
com
=
_
.
shuffle
(
com
)
com
=
_
.
shuffle
(
com
)
balance
=
lastBalance
balance
=
lastBalance
arr
=
[]
arr
=
[]
for
(
let
i
=
0
;
i
<
100
;
i
++
)
{
for
(
let
i
=
0
;
i
<
size
;
i
++
)
{
let
closeDate
=
com
[
i
].
closeDate
.
split
(
'
_
'
)
let
closeDate
=
com
[
i
].
closeDate
.
split
(
'
_
'
)
let
profits
=
com
[
i
].
profitLossString
.
split
(
'
_
'
)
let
profits
=
com
[
i
].
profitLossString
.
split
(
'
_
'
)
let
side
=
com
[
i
].
sideString
.
split
(
'
_
'
)
let
side
=
com
[
i
].
sideString
.
split
(
'
_
'
)
...
@@ -107,10 +117,15 @@ async function run()
...
@@ -107,10 +117,15 @@ async function run()
if
(
worth
<
base
)
{
if
(
worth
<
base
)
{
base
=
worth
base
=
worth
console
.
log
(
arrNew
[
0
].
sum
,
balance
,
worth
)
console
.
log
(
arrNew
[
0
].
sum
,
balance
,
worth
)
let
arr5
=
[]
for
(
let
f
=
0
;
f
<
100
;
f
++
)
{
arr5
.
push
(
com
[
f
])
}
// let z={maxReserve:arrNew[0].sum,balance:balance,bad:base}
// let z={maxReserve:arrNew[0].sum,balance:balance,bad:base}
//
//
// await createfileADV(JSON.stringify(z))
// await createfileADV(JSON.stringify(z))
await
lastCheck
(
arrNew
[
0
].
sum
,
balance
,
base
)
await
lastCheck
(
arrNew
[
0
].
sum
,
balance
,
base
,
arr5
)
}
}
// let start=false
// let start=false
// let arr2=[]
// let arr2=[]
...
@@ -202,3 +217,13 @@ function createfileADV(data) {
...
@@ -202,3 +217,13 @@ function createfileADV(data) {
});
});
});
});
}
}
function
createfileTorob
(
name
,
data
)
{
// console.log(data)
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
writeFile
(
name
+
'
.json
'
,
data
,
'
utf8
'
,
function
(
err
)
{
if
(
err
)
reject
(
err
);
else
resolve
(
data
);
});
});
}
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