Commit dc8e2e7a authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent c4df2915
......@@ -54,33 +54,43 @@ async function init() {
console.log('Worth ->',arrNew[0])
let worth=arrNew[0].sum
console.log('Detail ->',get(arrNew[0].date))
let index=arrNew[0].index
arrNew=[]
for (let i = index; i < index+1; i++) {
let sums = 0
for (let j = i + 1; j < arr.length ; j++) {
sums = sums + parseFloat(arr[j].profit)
// if (arrNew.length ===0)
// arrNew.push({sum: sums, index: i,date:arr[j].date})
// else if (arrNew[arrNew.length-1].sum > sums)
arrNew.push({sum: sums, index: i,date:arr[j].date})
let start=false
let arr2=[]
for (let i=0;i<arr.length;i++)
{
if (arr[i].date ===arrNew[0].startDate)
{
start=true
arr2.push(arr[i])
}
else if (arr[i].date === arrNew[0].date )
{
arr2.push(arr[i])
break
}
else if (start)
arr2.push(arr[i])
}
// for (let i=0;i<arrNew.length;i++)
// {
// let det=get(arrNew[i].date)
// if (worth ===arrNew[i].sum)
// console.log('Worth* ->',arrNew[i].date,'Profits->',arrNew[i].sum,'Count->',det.count,'Longs->',det.longCount,'Shorts->',det.shortCount)
// else
// console.log(arrNew[i].date,'Profits->',arrNew[i].sum,'Count->',det.count,'Longs->',det.longCount,'Shorts->',det.shortCount)
console.log(arr2)
// let index=arrNew[0].index
// arrNew=[]
// for (let i = index; i < index+1; i++) {
// let sums = 0
// for (let j = i + 1; j < arr.length ; j++) {
//
// sums = sums + parseFloat(arr[j].profit)
//
// // if (arrNew.length ===0)
// // arrNew.push({sum: sums, index: i,date:arr[j].date})
// // else if (arrNew[arrNew.length-1].sum > sums)
// arrNew.push({sum: sums, index: i,date:arr[j].date})
//
//
// }
//
// }
// console.log(arrNew)
}
......
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