Commit 44d87bd9 authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent 59b10d30
......@@ -155,6 +155,7 @@ function run(data, config, risk, forceZero, pfTrade, riskFreeLevel, detail, loss
let maxRuntime = 0
let realProfit = 0
let dateString = ''
let closeDate=''
let runupString = ''
let profitLossString = ''
let sideString = ''
......@@ -599,6 +600,7 @@ function run(data, config, risk, forceZero, pfTrade, riskFreeLevel, detail, loss
}
if (step === 0) {
dateString = dateString + data[i].openDate.split(' ')[0] + '_'
closeDate = closeDate + data[i].closeDate.split(' ')[0] + '_'
runupString = runupString + data[i].runUp + '_'
sideString = sideString + data[i].side + '_'
}
......@@ -1024,6 +1026,7 @@ function run(data, config, risk, forceZero, pfTrade, riskFreeLevel, detail, loss
runupString: runupString,
sideString: sideString,
profitLossString: profitLossString,
closeDate:closeDate
firstMaxAllocatedMoney: firstMaxAllocatedMoney,
maxAllocatedMoney: maxAllocatedMoney,
avgAllocatedMoney: maxAllocatedMoney / total,
......
let t="-4.87_-2.26_3.06_1.76_2.31_9.33_-5.79_3.77_-3.8_4.16_-3.7_7.21_0.46_0.97_30.32_-3.04_0.92_7.42_17.36_-1.09_0_-6.23_6.15_18.67_0.23_-6.76_-3.48_-2.8_15.71_7.28_23.26_6.44_10.35_-7.89_8.88_-10.7_-2.65_-6.47_-8.15_3.87_6.66_-6.02_-5.09_-4.19_-7.91_11.16_7.31_-8.16_-0.03_19.23_12.08_-10.25_-3.75_-4.73_17.09_2.03_-4.56_1.66_4.02_-1.39_17.2_-3.14_1.5_9.24_2.27_9.68_-3.51_5.82_7.94_4.88_-7.99_7.49_-2.76_0.01_10.99_-1.68_-3.53_-1.13_0.11_5.61_5.28_-4.33_-2.46_3.05_9.19_0.79_0.55_-0.56_-2.74_-0.68_0.38_-0.78_-2.85_-1.51_9.52_2.81_-2.76_-1.11_-2.38_-1.24_6.56_-3.33_-0.63_-2.99_0.02_-4.98_-1.4_-3.22_-2.32_-3.3_-1.3_6.37_-1.33_16.26_8.61_-0.5_12.98_6.66_-4.21_-2.55_0.55_1.96_-2.48_-2.8_-0.6_-1.76_0.74_-2.27_3.02_2.07_-2.5_-2.44_-1.71_1.21_-2.56_0.12_-1.35_-2.28_3.72_-1.62_-1.35_-0.9_-0.52_0.18_4.1_3.98_-2.46_1.23_-0.21_-0.5_-1.2_2.66_-1.76_10.8_19.45_2.31_-2.97_0.84_-3.05_-0.04_-4.2_8.42_-0.09_-1.7_3.02_1.85_6.22_-2.69_-1.03_-1.25_0.38_5.4_-2.23_-0.55_1.19_-0.98_-1.04_-0.74_3.15_-0.54_0.18_5.53_-2.07_-0.74_5.72_-1.3_-0.73_1.66_-1.1_-0.4_2.63_-0.08_21.58_2.68_1_-2.95_6.36_-2.89_-2.58_34.9_1.04_-2.4_6.01_-3.84_-0.91_-0.78_7.22_-2.02_-3.16_12.06_27.97_-4.83_6.76_-3.06_-3.09_6.76_5.5_2.42_-9.86_1.41_2.95_-2.92_-6.27_-1.79_-2.56_-2.7_10.01_5.39_-2.98_0.4_-2.52_7.7_-6.16_-4.21_-2.76_-0.47_0.99_-1.75_-1.39_5.16_-2.61_6.89_-1.69_1.24_-0.34_-1.79_-1.94_1.43_0.38_0.17_-1.45_16.74_-2.24_-0.95_-2.38_-2.93_1.22_4.96_2.62_-1.74_1.02_7.62_-1.98_-1.14_-0.36_2.07_-1.53_1.48_-0.79_-1.39_3_9.47_-5.26_1.98_-1.76_0.26_-5.19_-3.54_-0.41_-1.87_-2.43_1.79_1.78_-2.37_-2.39_-0.37_0.54_7.49_-1.8_1.23_-2_9.64_-1.25_-0.22_6.2_10.29_0.7_27.12_-7.76_-6.96_-9.56_6.26_0.84_3.07_5.11_3_-3.54_-3.29_-2.4_-2.79_2.8_24.58_8.57_-7.61_5.58_-0.3_-3.08_-1.98_3.6_-0.6_4.43_-1.64_-0.19_2.34_0.17_0.2_-0.06_-0.88_-1.32_1.42_-1.47_-0.86_-1.07_-0.61_1.56_-1.12_-1.45_-1.05_-0.73_0.25_-0.59_-0.72_3.12_17.3_-2_2.71_-1.9_-1.26_0.66_-3.03_0.14_-3.48_-0.75_2.71_-2.39_-3.09_-2.31_1.14_-0.88_11.42_-2.2_1.24_-0.95_3.31_-1.46_-2.24_-1.24_4.4_-0.96_-2.79_-0.72_0.52_-1.19_-0.99_-0.97_-0.25_13.32_0.89_-0.99_11.24_-2.47_2.86_12.06_-0.68_6.4_-2.43_-1.34_-1.27_3.75_-2.11_-2.9_10.4_15.17_21.01_-5.28_6.6_-3.8_-1.95_1.36_4.17_12.33_4.74_0.18_-6.37_12.59_3_-2.12_-0.27_-3.07_-3.46_21.66_-4.68_-2.41_2.53_1.45_0.57_-3.43_-1.71_0.18_-1.31_0.25_2.19_2.32_7.9_6.1_2.95_-1.64_0.86_-1.12_-3.42_-0.95_-3.17_-3.62_-0.08_-1.68_8.76_17.47_3.14_-7.25_3.19_-5.98_2.31_-0.36_-3.78_6.67_6.75_-5.89_-2.79_1.83_1.47_-0.29_-2.22_2.78_1.85_-4.51_7.13_0.74_2.1_-2.73_1.49_5.74_-1.16_0.18_-2.54_-0.56_0.07_-2.45_-2.93_-0.98_0.93_2.41_-0.88_-1.88_-1.35_3.23_-1.93_8.73_-1_0.22_10.02_14.9_4.76_3.76_4.28_-1.93_-0.55_-0.83_-2.62_-1.21_8.06_-3.07_1.51_9.78_-1.57_0.35_-0.89_3.79_-5.39_10.04_-1_-5.48_-5.51_-1.75_1.22_-1.69_-3.5_-2_1.2_-2.23_1.35_1.28_-1.56_4.41_-1.56_-2_-1.46_-3.97_6.78_-3.57_1.01_0.73_9.94_-2.4_0.29_-1.06_-0.41_0.54_-5.57_-0.21_-2.85_-2.44_1.77_9.82_-2.17_-1_-2.66_-1.02_-2.45_-4.08_-5.1_8.63_-5.11_3.74_-2.44_0.29_-2.42_8.94_-1.54_-2.43_-2.54_-2.07_-1.61_6.99_0.58_2.65_-3.35_2.25"
t = t.split('_')
let avg = 0
let avgProfit = 0
let countPorfit = 0
let avgLoss = 0
let countLoss = 0
for (let i = 0; i < t.length; i++) {
avg = avg + parseFloat(t[i])
if (parseFloat(t[i]) > 0.1) {
countPorfit++
avgProfit = avgProfit + parseFloat(t[i])
} else {
countLoss++
avgLoss=avgLoss+parseFloat(t[i])
}
}
avg = avg / t.length
avgProfit=avgProfit/countPorfit
avgLoss=avgLoss/countLoss
console.log(avg,avgProfit,avgLoss)
//2.218253968253969 8.027857142857144 -1.199159663865546
//1.1638599640933573 5.604080000000001 -2.451954397394137
\ No newline at end of file
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