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

init

parent aa035a5a
......@@ -13,15 +13,20 @@ let timeFrame = 0
function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, maxTradeDays, targetPercentage, candlesData, fft, fftPercent, fftRunup, fftPercentRunup, fftDiffDrawDownProfit, usage) {
let type = config.type + ' param:' + config.param + ' base:' + config.base + ' target:' + config.target + ' targetPercentage:' + targetPercentage.enable
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
}
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 +' '
}
}
let saveData = []
candles = candlesData
......@@ -114,21 +119,27 @@ function run(data, config, risk, pfTrade, riskFreeLevel, detail, loss, durs, max
if (runBefore === false) {
if (usage === 'fft') {
if (countDrop < fft)
continue
} else if (usage === 'fftPercent') {
if (allLossProfit > fftPercent)
continue
} else if (usage === 'fftRunup') {
if (countDropRunup < fftRunup)
continue
} else if (usage ==='fftDiffDrawDownProfit') {
if (diffDrawdownProfitAll > fftDiffDrawDownProfit)
continue
for (let z=0;z<usage.length;z++)
{
if (usage[z] === 'fft') {
if (countDrop < fft)
continue
} else if (usage[z] === 'fftPercent') {
if (allLossProfit > fftPercent)
continue
} else if (usage[z] === 'fftRunup') {
if (countDropRunup < fftRunup)
continue
} else if (usage[z] ==='fftDiffDrawDownProfit') {
if (diffDrawdownProfitAll > fftDiffDrawDownProfit)
continue
}
}
}
runBefore = true
......
......@@ -20,7 +20,7 @@ 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'}
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 detail=['configs2.json-211021092159_O1_BNC_BTCUSD_Lp1_Y211020a - Copy_Mn.csv&zarib param:1.1 base:200 target:1']
obj.detail=detail
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