Commit 50e7101e authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent ccae9ca9
...@@ -47,10 +47,20 @@ async function init() { ...@@ -47,10 +47,20 @@ async function init() {
console.log(file , config) console.log(file , config)
dataFile.push(data) dataFile.push(data)
} }
let lastConfig=[]
for (let i=0;i<dataFile.length;i++)
{
console.log(dataFile[0]) let last=dataFile[i].split(',')
let name=dataFile[dataFile.length-1]
let timeStamp=last[13]
let pvtPeriod=last[14]
let atrFactor=last[15]
let atrPeriod=last[16]
lastConfig.push({name:name,timeStamp:timeStamp,pvtPeriod:pvtPeriod,atrFactor:atrFactor,atrPeriod:atrPeriod})
}
createRunResfileADV(JSON.stringify(lastConfig, null, 2))
} }
...@@ -79,6 +89,15 @@ async function format(name) { ...@@ -79,6 +89,15 @@ async function format(name) {
// console.log(res[0]) // console.log(res[0])
return res return res
} }
function createRunResfileADV(data) {
// console.log(data)
return new Promise(function (resolve, reject) {
fs.writeFile('runres.json', data, 'utf8', function (err) {
if (err) reject(err);
else resolve(data);
});
});
}
function createFile(name, body) { function createFile(name, body) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
......
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' let t='1000,4845,2,0.10,2.633,1.655%,4.357%,435.71,-0.720,6.053%,-4.357%,-435.71,435.707,000 00:05:00.000,39,3.200,1,,,,,1,,,,,,,-1,999999,999999,000 00:00:19.000,4845,4845,NaN,NaN,0,0,0,0,0,0,0,10000.000,True,True,0.10,0.000,200,100,1400,False,False,True,484.50,242.30,242.20,6713759,1, 0, 0, 0,2423,2422,4845,0.100,2017.08.17 16:45:00.000,2017.08.17 16:50:00.000,0.100,2017.08.17 16:50:00.000,2017.08.17 19:30:00.000,10548.21,548.21,2021.12.04 05:28:19.999,2021.12.04 05:28:39.999,9939.20,-60.80,2018.01.27 03:38:19.999,2018.01.27 03:38:39.999,2017.08.17 16:50:00.000,2017.08.17 16:50:00.000,2017.08.17 16:45:00.000,2017.08.17 16:50:00.000,174.547,10000.00,10548.21,548.21,10373.66,373.66,2021.12.04 05:28:19.999,2022.01.05 17:48:19.999,609.010,10000.00,10060.80,60.80,9451.79,-548.21,2018.01.27 03:38:19.999,2021.12.04 05:28:19.999,9999.12.31 23:59:59.999,2017.08.17 04:00:00.000,2023.12.01 00:00:00.000,2296d 20:00:00,"Lp1000_1ETH1"'
let last=t.split('_') let last=t.split(',')
let config=last[last.length-2].replace('.csv','') let timeStamp=last[13]
let file=last[last.length-1].replace('.csv','') let pvtPeriod=last[14]
console.log(file) let atrFactor=last[15]
\ No newline at end of file let atrPeriod=last[16]
console.log(atrFactor)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment