Commit 81ae27e5 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent d44d172d
......@@ -8,6 +8,8 @@ async function run() {
let configs = await fs.readdirSync('uniq/')
let arr = []
let arrDate = []
let arrSide=[]
let arrRunup=[]
let levels = []
let types = []
......@@ -22,9 +24,16 @@ async function run() {
levels.push(config[j].maxLevel)
types.push(config[j].type.split('targetPercentage:false')[1])
let dateString = config[j].dateString.split('_')
let sideString = config[j].sideString.split('_')
let runUpString = config[j].runupString.split('_')
for (let z = 0; z < dateString.length - 1; z++)
arrDate.push(dateString[z])
for (let z = 0; z < sideString.length - 1; z++)
arrSide.push(sideString[z])
for (let z = 0; z < runUpString.length - 1; z++)
arrRunup.push(runUpString[z])
arr.push(config[j])
}
......@@ -34,14 +43,34 @@ async function run() {
// console.log(arr)
arr = _.uniqBy(arr, 'platform');
let allDates=arrDate
arrDate = _.uniq(arrDate);
let uniqLevels = _.uniq(levels);
let uniqType = _.uniq(types);
arrDate = _.orderBy(arrDate)
let sides=['LONG','SHORT']
let runUpunder1=0
let runUpUnder11=0
for (let i=0;i<arrRunup.length;i++)
{
if (arrRunup[i] <1)
runUpunder1++
if (arrRunup[i]<1.1)
runUpUnder11++
}
console.log('Count of runUp<1 :'+runUpunder1)
console.log('Count of runUp<1.1 :'+runUpUnder11)
// await createfileADV()
let levelSort = []
let typeSort = []
let sideSort=[]
for (let i = 0; i < uniqLevels.length; i++) {
let counter = 0
for (let j = 0; j < levels.length; j++)
......@@ -58,6 +87,17 @@ async function run() {
typeSort.push({type: uniqType[i], count: counter})
}
for (let i = 0; i < sides.length; i++) {
let counter = 0
for (let j = 0; j < arrSide.length; j++)
if (sides[i] === arrSide[j])
counter++
sideSort.push({type: sides[i], count: counter})
}
typeSort = _.orderBy(typeSort, ['count'], ['desc']);
console.log('All Uniq Platform:' + arr.length)
console.log('All Uniq Date:' + arrDate.length)
......@@ -65,7 +105,18 @@ async function run() {
console.log(levelSort)
console.log(typeSort)
// console.log(JSON.stringify(arrDate, null, 2))
createfileADV(JSON.stringify(arrDate, null, 2))
let arrDateSortCount=[]
for (let i = 0; i < arrDate.length; i++) {
let counter = 0
for (let j = 0; j < allDates.length; j++)
if (arrDate[i] === allDates[j])
counter++
arrDateSortCount.push({day: sides[i], count: counter})
}
createfileADV(JSON.stringify(arrDateSortCount, null, 2))
let maxDiff = 0
for (let i = 0; i < arrDate.length - 1; i++) {
let diff = getDaysDiff(arrDate[i], arrDate[i + 1])
......
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