Commit 6a0dc99b authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent 8012cf6b
...@@ -28,32 +28,7 @@ async function init() { ...@@ -28,32 +28,7 @@ async function init() {
let com = await fs.readFileSync('com.json', 'utf8'); let com = await fs.readFileSync('com.json', 'utf8');
com = JSON.parse(com) com = JSON.parse(com)
for (let i = 0; i < com.length; i++) {
com[i].platform = com[i].platform.toLowerCase()
let t = com[i].platform
t = t.split('_')
let pair = t[3].replace('usdt', '').replace('usd', '')
let lp = t[4].replace('lp', 'Lp')
com[i].lp = lp
let p = t[t.length - 1].split('.')
p = p[0].split(pair)[0]
let uniq = pair + lp + p + capital(com[i].type.split(' ')[5]) + parseFloat(com[i].type.split(' ')[6]) * -10
com[i].uniq = uniq + '_' + com[i].avgRunup + '_' + com[i].avgDrawdown + '_' + com[i].type.split(' ')[5] + '_' + (parseFloat(com[i].type.split(' ')[6]) * -1)
}
com = _.uniqBy(com, 'lp');
let newCom = []
for (let i = 0; i < com.length; i++) {
newCom.push(com[i])
}
com = newCom
createComResfileADV(JSON.stringify(com, null, 2))
for (let i = 0; i < com.length; i++) { for (let i = 0; i < com.length; i++) {
...@@ -76,18 +51,21 @@ async function init() { ...@@ -76,18 +51,21 @@ async function init() {
struc=indicator2Temp struc=indicator2Temp
struc=struc.replace('ahmadTimeframe',f.timeframe).replace('ahmadnAtrPeriod',f.nAtrPeriod).replace('ahmaddAtrMultiplier',f.dAtrMultiplier).replace('ahmadlp',f.lp) struc=struc.replace('ahmadTimeframe',f.timeframe).replace('ahmadnAtrPeriod',f.nAtrPeriod).replace('ahmaddAtrMultiplier',f.dAtrMultiplier).replace('ahmadlp',f.lp)
createConfigYashilADV('btc'+indicator+'&'+parseFloat(f.nAtrPeriod)+'&'+parseFloat(f.dAtrMultiplier)+'&'+f.lp,struc) createConfigYashilADV('btc'+indicator+'&'+parseFloat(f.nAtrPeriod)+'&'+parseFloat(f.dAtrMultiplier)+'&'+f.lp,struc)
com[i].lp='btc'+indicator+'&'+parseFloat(f.nAtrPeriod)+'&'+parseFloat(f.dAtrMultiplier)+'&'+f.lp
} }
if (indicator ===3) if (indicator ===3)
{ {
struc=indicator3Temp struc=indicator3Temp
struc=struc.replace('ahmadTimeframe',f.timeframe).replace('ahmadnStochPeriod',f.nStochPeriod).replace('ahmadnStochSmoothingPeriod',f.nStochSmoothingPeriod).replace('ahmaddOttPercent',f.dOttPercent).replace('ahmadnOttPeriod',f.lp) struc=struc.replace('ahmadTimeframe',f.timeframe).replace('ahmadnStochPeriod',f.nStochPeriod).replace('ahmadnStochSmoothingPeriod',f.nStochSmoothingPeriod).replace('ahmaddOttPercent',f.dOttPercent).replace('ahmadnOttPeriod',f.lp)
createConfigYashilADV('btc'+indicator+'&'+parseFloat(f.nStochPeriod)+'&'+parseFloat(f.nStochSmoothingPeriod)+'&'+f.lp,struc) createConfigYashilADV('btc'+indicator+'&'+parseFloat(f.nStochPeriod)+'&'+parseFloat(f.nStochSmoothingPeriod)+'&'+f.lp,struc)
com[i].lp='btc'+indicator+'&'+parseFloat(f.nStochPeriod)+'&'+parseFloat(f.nStochSmoothingPeriod)+'&'+f.lp
} }
if (indicator ===4) if (indicator ===4)
{ {
struc=indicator4 struc=indicator4
struc=struc.replace('ahmadstMnMaBarAge',f.timeframe).replace('ahmadMnKeltner_nMidLnMaPeriod',f.nMidLnMaPeriod).replace('ahmadMnKeltner_dMultiplier',f.dMultiplier).replace('ahmadMnKeltner_nBandsAtrPeriod',f.lp) struc=struc.replace('ahmadstMnMaBarAge',f.timeframe).replace('ahmadMnKeltner_nMidLnMaPeriod',f.nMidLnMaPeriod).replace('ahmadMnKeltner_dMultiplier',f.dMultiplier).replace('ahmadMnKeltner_nBandsAtrPeriod',f.lp)
createConfigYashilADV('btc'+indicator+'&'+parseFloat(f.nMidLnMaPeriod)+'&'+parseFloat(f.dMultiplier)+'&'+f.lp,struc) createConfigYashilADV('btc'+indicator+'&'+parseFloat(f.nMidLnMaPeriod)+'&'+parseFloat(f.dMultiplier)+'&'+f.lp,struc)
com[i].lp='btc'+indicator+'&'+parseFloat(f.nMidLnMaPeriod)+'&'+parseFloat(f.dMultiplier)+'&'+f.lp
} }
...@@ -98,6 +76,33 @@ async function init() { ...@@ -98,6 +76,33 @@ async function init() {
} }
arr = _.uniqBy(arr, 'name'); arr = _.uniqBy(arr, 'name');
createfinalADV(JSON.stringify(arr, null, 2)) createfinalADV(JSON.stringify(arr, null, 2))
for (let i = 0; i < com.length; i++) {
com[i].platform = com[i].platform.toLowerCase()
let t = com[i].platform
t = t.split('_')
let pair = t[3].replace('usdt', '').replace('usd', '')
// let lp = t[4].replace('lp', 'Lp')
// com[i].lp = lp
let p = t[t.length - 1].split('.')
p = p[0].split(pair)[0]
let uniq = pair + com[i].lp + p + capital(com[i].type.split(' ')[5]) + parseFloat(com[i].type.split(' ')[6]) * -10
com[i].uniq = uniq + '_' + com[i].avgRunup + '_' + com[i].avgDrawdown + '_' + com[i].type.split(' ')[5] + '_' + (parseFloat(com[i].type.split(' ')[6]) * -1)
}
com = _.uniqBy(com, 'lp');
let newCom = []
for (let i = 0; i < com.length; i++) {
newCom.push(com[i])
}
com = newCom
createComResfileADV(JSON.stringify(com, null, 2))
// console.log(arr) // console.log(arr)
......
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