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
c870c424
Commit
c870c424
authored
Jul 24, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pull
parent
8a7db7e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
134 additions
and
0 deletions
+134
-0
renamer.js
renamer.js
+134
-0
No files found.
renamer.js
0 → 100644
View file @
c870c424
const
fs
=
require
(
'
fs
'
)
let
moment
=
require
(
'
moment-timezone
'
)
let
_
=
require
(
'
lodash
'
)
const
uuid
=
require
(
'
uniqid
'
)
let
pairs
=
''
let
res2
let
res3
let
res4
init
()
async
function
init
()
{
let
com
=
await
fs
.
readFileSync
(
'
newCom.json
'
,
'
utf8
'
);
com
=
JSON
.
parse
(
com
)
console
.
log
(
com
)
for
(
let
i
=
0
;
i
<
com
.
length
;
i
++
)
{
}
}
function
isUpper
(
str
)
{
return
!
/
[
a-z
]
/
.
test
(
str
)
&&
/
[
A-Z
]
/
.
test
(
str
);
}
function
capital
(
t
)
{
let
f
=
''
for
(
let
j
=
0
;
j
<
t
.
length
;
j
++
)
if
(
isUpper
(
t
[
j
]))
f
=
f
+
t
[
j
]
return
f
}
function
createRunResfileADV
(
data
)
{
// console.log(data)
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
writeFile
(
pairs
+
'
_TOP.csv
'
,
data
,
'
utf8
'
,
function
(
err
)
{
if
(
err
)
reject
(
err
);
else
resolve
(
data
);
});
});
}
function
createComResfileADV
(
data
)
{
// console.log(data)
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
writeFile
(
'
newCom.json
'
,
data
,
'
utf8
'
,
function
(
err
)
{
if
(
err
)
reject
(
err
);
else
resolve
(
data
);
});
});
}
function
createfinalADV
(
data
)
{
// console.log(data)
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
writeFile
(
'
final.json
'
,
data
,
'
utf8
'
,
function
(
err
)
{
if
(
err
)
reject
(
err
);
else
resolve
(
data
);
});
});
}
function
found
(
indicator
,
pair
,
lp
)
{
// console.log(indicator,lp)
let
res
=
[]
if
(
indicator
===
2
)
res
=
res2
else
if
(
indicator
===
3
)
res
=
res3
else
if
(
indicator
===
4
)
res
=
res4
if
(
res
.
length
===
0
)
return
{
timeframe
:
0
}
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
)
{
if
(
!
res
[
i
].
includes
(
lp
+
'
_
'
))
continue
let
d
=
res
[
i
].
split
(
'
,
'
)
let
timeframe
=
d
[
13
]
timeframe
=
timeframe
.
split
(
'
'
)
let
newTimeframe
=
'
0d
'
for
(
let
z
=
1
;
z
<
timeframe
.
length
;
z
++
)
{
newTimeframe
=
newTimeframe
+
timeframe
[
z
]
if
(
z
!==
timeframe
.
length
-
1
)
newTimeframe
=
newTimeframe
+
'
'
}
if
(
indicator
===
2
)
return
{
timeframe
:
newTimeframe
,
nAtrPeriod
:
d
[
15
],
dAtrMultiplier
:
d
[
17
]}
if
(
indicator
===
3
)
return
{
timeframe
:
newTimeframe
,
nStochPeriod
:
d
[
15
],
nStochSmoothingPeriod
:
d
[
16
],
dOttPercent
:
d
[
18
]}
if
(
indicator
===
4
)
return
{
timeframe
:
newTimeframe
,
nMidLnMaPeriod
:
d
[
14
],
dMultiplier
:
d
[
15
]}
// timeframe=newTimeframe
// let nStochPeriod=parseFloat(d[15])
// let nStochSmoothingPeriod=parseFloat(d[16])
// let dOttPercent=parseFloat(d[18])
//
// let name = d[92]
// return {name, timeframe, nStochPeriod, nStochSmoothingPeriod, dOttPercent}
return
{
timeframe
}
}
}
function
createConfigYashilADV
(
name
,
data
)
{
// console.log(data)
return
new
Promise
(
function
(
resolve
,
reject
)
{
fs
.
writeFile
(
'
YConfig/
'
+
name
+
'
.txt
'
,
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