Commit 31b5cae5 authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent b8b55a55
......@@ -22,7 +22,7 @@ let dates = []
for (let i = 0; i < year.length; i++) {
for (let j = 0; j < month.length; j++) {
let t = year[i] + '-' + month[j]
if (!(t === '2017-01' || t === '2017-02' || t === '2017-03' || t === '2017-04' || t === '2017-05' || t === '2017-06' || t === '2017-07' || t === '2022-05' ||t === '2022-06' || t === '2022-07' || t === '2022-08' || t === '2022-09' || t === '2022-10' || t === '2022-11' || t === '2022-12'))
if (!(t === '2017-01' || t === '2017-02' || t === '2017-03' || t === '2017-04' || t === '2017-05' || t === '2017-06' || t === '2017-07' || t === '2017-08'|| t === '2022-05' ||t === '2022-06' || t === '2022-07' || t === '2022-08' || t === '2022-09' || t === '2022-10' || t === '2022-11' || t === '2022-12'))
dates.push({date: t, profit: 0,count:0,longCount:0,shortCount:0,longProfit:0,shortProfit:0})
}
}
......@@ -123,7 +123,7 @@ async function run()
}
arrNew = _.orderBy(arrNew, ['sum'])
console.log(arrNew[0])
// console.log(arrNew[0])
// console.log(arrNew)
for (let i=0;i<arr.length;i++)
addDate(arr[i])
......@@ -131,7 +131,9 @@ async function run()
// dates=_.orderBy(dates,['profit'])
let arrDate=[]
console.log(dates)
// console.log(dates)
// for (let i=0;i<arr.length;i++)
// console.log(arr[i].date,arr[i].profit)
for (let i = 0; i < dates.length; i++) {
let sums = 0
for (let j = i + 1; j < dates.length ; j++) {
......@@ -147,8 +149,13 @@ async function run()
}
}
// balance=lastBalance
// for (let i = 0; i < dates.length; i++) {
// balance = balance + dates[i].profit
// dates[i].balance = balance
// }
arrDate = _.orderBy(arrDate, ['sum'])
console.log(arrDate)
console.log(dates)
console.log('Balance ->',balance-lastBalance)
let worth = (balance - lastBalance) / (arrDate[0].sum)
console.log('Worth ->',worth)
......
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