Commit 42b66eab authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 16a1e113
......@@ -46,6 +46,9 @@ async function format(name) {
let greenCounter=0
let maxGreenArray=[]
let maxRedArray=[]
let maxTimeGreen=0
let maxTimeRed=0
for (let i = 1; i < (res.length - 1); i++) {
try {
let d = res[i].split(',')
......@@ -54,16 +57,20 @@ async function format(name) {
if (close < open) {
if (greenCounter !==0)
maxGreenArray.push(greenCounter)
if (greenCounter>maxGreen)
maxGreen=greenCounter
if (greenCounter>maxGreen) {
maxTimeGreen=d[0]
maxGreen = greenCounter
}
greenCounter=0
redCounter++
con++
} else {
if (redCounter !==0)
maxRedArray.push(redCounter)
if (redCounter > maxRed)
if (redCounter > maxRed) {
maxTimeRed=d[0]
maxRed = redCounter
}
redCounter = 0
greenCounter++
allGreeeCon++
......@@ -82,7 +89,7 @@ async function format(name) {
// twoCounter++
console.log('from ' + res.length + ' red ' + con, ' max red:'+maxRed ,' green:'+allGreeeCon +' max green:'+maxGreen)
console.log('from ' + res.length + ' red ' + con, ' max red:'+maxRed ,'Max red Timestamp:'+maxTimeRed ,' green:'+allGreeeCon +' max green:'+maxGreen + ' max green time end:'+maxTimeGreen)
// console.log('total '+con +' avg runup:'+(allProfit/con))
maxRedArray=_.orderBy(maxRedArray)
maxRedArray=_.reverse(maxRedArray)
......
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