Skip to content

Commit

Permalink
reduce logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrddter committed Oct 28, 2024
1 parent fe76806 commit ced6f76
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions src/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,66 +37,66 @@ 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', {
interval: '1d',
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',
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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()

0 comments on commit ced6f76

Please sign in to comment.