Commit a3f7f444 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 6f7e3884
...@@ -15,18 +15,18 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max ...@@ -15,18 +15,18 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
let type = config.type + ' param:' + config.param + ' base:' + config.base + ' target:' + config.target + ' targetPercentage:' + targetPercentage.enable let type = config.type + ' param:' + config.param + ' base:' + config.base + ' target:' + config.target + ' targetPercentage:' + targetPercentage.enable
for (let i=0;i<usage.length;i++) for (let i=0;i<usage.length;i++)
{ {
if (usage[i] === 'fft') {
type = type + ' ' + usage[i] + ' ' + fft +' '
} else if (usage[i] === 'fftPercent') {
type = type + ' ' + usage[i] + ' ' + fftPercent +' '
} else if (usage[i] === 'fftRunup') {
type = type + ' ' + usage[i] + ' ' + fftRunup +' '
} else if (usage[i] ==='fftDiffDrawDownProfit') {
type = type + ' ' + usage[i] + ' ' + fftDiffDrawDownProfit +' '
}
}
}
if (usage === 'fft') {
type = type + ' ' + usage + ' ' + fft +' '
} else if (usage === 'fftPercent') {
type = type + ' ' + usage + ' ' + fftPercent +' '
} else if (usage === 'fftRunup') {
type = type + ' ' + usage + ' ' + fftRunup +' '
} else if (usage ==='fftDiffDrawDownProfit') {
type = type + ' ' + usage + ' ' + fftDiffDrawDownProfit +' '
}
let saveData = [] let saveData = []
candles = candlesData candles = candlesData
...@@ -119,27 +119,21 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max ...@@ -119,27 +119,21 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
if (runBefore === false) { if (runBefore === false) {
if (usage === 'fft') {
for (let z=0;z<usage.length;z++) if (countDrop < fft)
{ continue
if (usage[z] === 'fft') { } else if (usage === 'fftPercent') {
if (countDrop < fft) if (allLossProfit > fftPercent)
continue continue
} else if (usage[z] === 'fftPercent') { } else if (usage === 'fftRunup') {
if (allLossProfit > fftPercent) if (countDropRunup < fftRunup)
continue continue
} else if (usage[z] === 'fftRunup') { } else if (usage ==='fftDiffDrawDownProfit') {
if (countDropRunup < fftRunup) if (diffDrawdownProfitAll > fftDiffDrawDownProfit)
continue continue
} else if (usage[z] ==='fftDiffDrawDownProfit') {
if (diffDrawdownProfitAll > fftDiffDrawDownProfit)
continue
}
} }
} }
runBefore = true runBefore = true
......
...@@ -20,7 +20,7 @@ run() ...@@ -20,7 +20,7 @@ run()
async function run() async function run()
{ {
let obj={sort:'profitPerMonthDrawDown',alocatedReserve:3,alocatedReserveCompound:3,risk:0,start:10000,pfTrade:2,side:'both',riskFreeLevel:100,onlyShortLong:false,loss:0,level:200,dur:1500,maxTradeDays:40,targetPercentage:{enable:true},fft:1,fftPercent:-2,fftRunup:2,fftPercentRunup:2,fftDiffDrawDownProfit:-0.5,usage:['fft','fftRunup']} let obj={sort:'profitPerMonthDrawDown',alocatedReserve:3,alocatedReserveCompound:3,risk:0,start:10000,pfTrade:2,side:'both',riskFreeLevel:100,onlyShortLong:false,loss:0,level:200,dur:1500,maxTradeDays:40,targetPercentage:{enable:true},fft:1,fftPercent:-2,fftRunup:2,fftPercentRunup:2,fftDiffDrawDownProfit:-0.5,usage:'fft'}
let detail=['configs2.json-211021092159_O1_BNC_BTCUSD_Lp1_Y211020a - Copy_Mn.csv&zarib param:1.1 base:200 target:1'] let detail=['configs2.json-211021092159_O1_BNC_BTCUSD_Lp1_Y211020a - Copy_Mn.csv&zarib param:1.1 base:200 target:1']
obj.detail=detail obj.detail=detail
let all=[] let all=[]
......
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