Commit d932494e authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent 32cf859f
......@@ -5,22 +5,30 @@ const uuid = require('uniqid')
let pair = 'BNB'
let res
let arr = []
let balance =1000
init()
async function init() {
let com = await fs.readFileSync('t.json', 'utf8');
com = JSON.parse(com)
for (let i = 0; i < 2; i++) {
for (let i = 0; i < 10; i++) {
let closeDate = com[i].closeDate.split('_')
let profits = com[i].profitLossString.split('_')
for (let j = 0; j < closeDate.length - 1; j++)
add(closeDate[j], parseFloat(profits[j]))
add(closeDate[j], parseFloat(profits[j])-0.1)
}
arr=_.orderBy(arr,['date'])
for (let i=0;i<arr.length;i++)
{
balance=balance+arr[i].profit
arr[i].balance=balance
}
console.log(arr)
console.log('Balance ->',balance)
}
......
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