Commit 1eca52e8 authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent 7fd2e4a3
1
\ No newline at end of file
...@@ -10,11 +10,15 @@ let balance =lastBalance ...@@ -10,11 +10,15 @@ let balance =lastBalance
init() init()
let base=1 let base=1
let com let com
//profitLossString //profitLossString
//drawDownString //drawDownString
async function init() { async function init() {
com = await fs.readFileSync('t.json', 'utf8'); com = await fs.readFileSync('t.json', 'utf8');
let bad = await fs.readFileSync('bad.txt', 'utf8');
base=parseFloat(bad)
com = JSON.parse(com) com = JSON.parse(com)
...@@ -70,6 +74,7 @@ function run() ...@@ -70,6 +74,7 @@ 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)
createfileADV(worth)
} }
// let start=false // let start=false
// let arr2=[] // let arr2=[]
...@@ -155,7 +160,7 @@ function get(date) { ...@@ -155,7 +160,7 @@ function get(date) {
function createfileADV(data) { function createfileADV(data) {
// console.log(data) // console.log(data)
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
fs.writeFile('worth.json', data, 'utf8', function (err) { fs.writeFile('bad.txt', data, 'utf8', function (err) {
if (err) reject(err); if (err) reject(err);
else resolve(data); else resolve(data);
}); });
......
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