From ced6f7635de2f9d4d3daaea96f262538fc87e641 Mon Sep 17 00:00:00 2001 From: Davide Morra Date: Mon, 28 Oct 2024 11:56:15 +0100 Subject: [PATCH] reduce logs --- src/demo.ts | 62 ++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/demo.ts b/src/demo.ts index f1708af..83fed67 100644 --- a/src/demo.ts +++ b/src/demo.ts @@ -37,11 +37,11 @@ async function main() { const endTime = new Date('2024-10-14').getTime() const found = await findHistoricalData('BTCEUR-8h') - console.log(found) + console.log('found:', found) if (found) { const deleted = await deleteHistoricalData('BTCEUR-8h') - console.log(deleted) + console.log('deleted:', deleted) } const downloaded2 = await downloadHistoricalData('BTCEUR', { @@ -49,54 +49,54 @@ async function main() { startDate: startDate, endDate: endDate }) - console.log(downloaded2) + console.log('downloaded2:', downloaded2) const downloaded1 = await downloadHistoricalData('BTCEUR', { interval: '1h', startDate: startDate, endDate: endDate }) - console.log(downloaded1) + console.log('downloaded1:', downloaded1) const downloaded = await downloadHistoricalData('BTCEUR', { interval: '8h', startDate: startDate, endDate: endDate }) - console.log(downloaded) + console.log('downloaded:', downloaded) const exported = await exportFileCSV('BTCEUR-8h') - console.log(exported) + console.log('exported:', exported) const allNames = await findHistoricalDataNames() - console.log(allNames) + console.log('allNames:', allNames) const allSets = await findHistoricalDataSets() - console.log(allSets) + console.log('allSets:', allSets.map(({ name }) => name).join(',')) const dataSet = await findHistoricalData('BTCEUR-8h') - console.log(dataSet) + console.log('dataSet:', dataSet) const dataSet1 = await findHistoricalData('BTCEUR-1h') - console.log(dataSet1) + console.log('dataSet1:', dataSet1) const deleted = await deleteHistoricalData('BTCEUR-8h') - console.log(deleted) + console.log('deleted:', deleted) const imported = await importFileCSV('BTC', 'EUR', '8h', './csv/BTCEUR-8h.csv') - console.log(imported) + console.log('imported:', imported) const dataSet2 = await findHistoricalData('BTCEUR-8h') - console.log(dataSet2) + console.log('dataSet2:', dataSet2) const scan = await scanStrategies() - console.log(scan) + console.log('scan:', scan) const strategies = await findStrategies() - console.log(strategies) + console.log('strategies:', strategies) const strategiesNames = await findStrategyNames() - console.log(strategiesNames) + console.log('strategiesNames:', strategiesNames) const runStrategyResult = await runStrategy({ strategyName: 'demo', @@ -109,22 +109,22 @@ async function main() { startTime: startTime, endTime: endTime }) - console.log(runStrategyResult) + console.log('runStrategyResult:', runStrategyResult.name) const parsed = await parseRunResultsStats(runStrategyResult) - console.log(parsed) + console.log('parsed:', parsed?.totals[0], parsed?.totals[1]) // just to show somethings (probably, you need to look parsed or strategyResult) const saved = await saveResult('demo-results', runStrategyResult as StrategyResult, true) - console.log(saved) + console.log('saved:', saved) const resultsNames = await findResultNames() - console.log(resultsNames) + console.log('resultsNames:', resultsNames) const allResults = await findResults() - console.log(allResults) + console.log('allResults:', allResults.length) const deletedResults = await deleteResult('demo-results') - console.log(deletedResults) + console.log('deletedResults:', deletedResults) const runMultiStrategyResult = await runStrategy({ strategyName: 'demo', @@ -136,25 +136,25 @@ async function main() { percentFee: 0, percentSlippage: 0 }) - console.log(runMultiStrategyResult) + console.log('runMultiStrategyResult:', runMultiStrategyResult.name) const parsedMulti = await parseRunResultsStats(runMultiStrategyResult) - console.log(parsedMulti) + console.log('parsedMulti:', parsedMulti?.totals[0], parsedMulti?.totals[1]) // just to show somethings (probably, you need to look parsed or strategyResult) const savedMulti = await saveMultiResult('demo-multi-results', runMultiStrategyResult as StrategyResultMulti) - console.log(savedMulti) + console.log('savedMulti:', savedMulti) const multiResultsNames = await findMultiResultNames() - console.log(multiResultsNames) + console.log('multiResultsNames:', multiResultsNames) const allMultiResults = await findMultiResults() - console.log(allMultiResults) + console.log('allMultiResults:', allMultiResults.length) const deletedMultiResult = await deleteMultiResult('demo-multi-results') - console.log(deletedMultiResult) + console.log('deletedMultiResult:', deletedMultiResult) const multiResultsNames2 = await findMultiResultNames() - console.log(multiResultsNames2) + console.log('multiResultsNames2:', multiResultsNames2) const runAdvancedStrategyResult = await runStrategy({ strategyName: 'demo', @@ -171,10 +171,10 @@ async function main() { percentSlippage: 0, rootPath: undefined }) - console.log(runStrategyResult) + console.log('runStrategyResult:', runStrategyResult.name) const parsedAdvanced = await parseRunResultsStats(runAdvancedStrategyResult) - console.log(parsedAdvanced.totals[0], parsedAdvanced.totals[1]) + console.log('parsedAdvanced:', parsedAdvanced.totals[0], parsedAdvanced.totals[1]) // just to show somethings (probably, you need to look parsed or strategyResult) } main()