Bug Fixed, almost all debuged

This commit is contained in:
Luis Fernando Molina committed 2021-02-02 18:44:15 +01:00
1 parent 2789487ae2
commit 85211ab486
6 files changed
+43 -21

No files matched your search

@@ -38,7 +38,13 @@ exports.newSuperalgosBotModulesSnapshots = function (processIndex) {
let positionValues
let addToPositionValues
/*
These 3 are the main data structures available to users
when writing conditions and formulas.
*/
let chart
let exchange
let market
return thisObject
@@ -58,10 +64,18 @@ exports.newSuperalgosBotModulesSnapshots = function (processIndex) {
strategyKeys = undefined
chart = undefined
exchange = undefined
market = undefined
}
function updateChart(pChart) {
function updateChart(pChart, pExchange, pMarket) {
/*
We need these 3 data structures to be a local objects
accessible while evaluating conditions and formulas.
*/
chart = pChart
exchange = pExchange
market = pMarket
}
function strategyEntry() {
@@ -28,8 +28,8 @@ exports.newSuperalgosBotModulesTradingOutput = function (processIndex) {
async function start(
chart,
exchange,
market,
exchange,
timeFrame,
timeFrameLabel,
tradingProcessDate
@@ -80,8 +80,8 @@ exports.newSuperalgosBotModulesTradingOutput = function (processIndex) {
await tradingSimulationModuleObject.runSimulation(
chart,
exchange,
market,
exchange,
outputDatasetsMap,
writeFiles
)
@@ -341,7 +341,7 @@
continue
}
if (dataDependenciesModule.filters.exchange.timeFrames.get(datasetModule.exchange, datasetModule.market, datasetModule.product, 'atAnyTimeFrame') !== true) {
if (dataDependenciesModule.filters.exchange.timeFrames.get(datasetModule.exchange + '-' + datasetModule.market + '-' + datasetModule.product + '-' + 'atAnyTimeFrame') !== true) {
/*
If we can not find the current data set is used at the current time
frame we will skip this file.
@@ -405,7 +405,7 @@
continue
}
if (dataDependenciesModule.filters.exchange.timeFrames.get(datasetModule.exchange, datasetModule.market, datasetModule.product, timeFrameLabel) !== true) {
if (dataDependenciesModule.filters.exchange.timeFrames.get(datasetModule.exchange + '-' + datasetModule.market + '-' + datasetModule.product + '-' + timeFrameLabel) !== true) {
/*
If we can not find the current data set is used at the current time
frame we will skip this file, unless we are in the only special
@@ -520,7 +520,7 @@
continue
}
if (dataDependenciesModule.filters.exchange.timeFrames.get(datasetModule.exchange, datasetModule.market, datasetModule.product, timeFrameLabel) !== true) {
if (dataDependenciesModule.filters.exchange.timeFrames.get(datasetModule.exchange + '-' + datasetModule.market + '-' + datasetModule.product + '-' + timeFrameLabel) !== true) {
/*
If we can not find the current data set is used at the current time
frame we will skip this file, unless we are in the only special
@@ -662,7 +662,7 @@
TS.projects.superalgos.functionLibraries.singleMarketFunctions.inflateDatafiles(processIndex, dataFiles, dataDependencies, products, mainDependency, currentTimeFrame)
let propertyName = 'at' + timeFrameLabel.replace('-', '')
addProducs(propertyName)
addProducs(propertyName, products)
}
}
@@ -676,22 +676,24 @@
TS.projects.superalgos.functionLibraries.singleMarketFunctions.inflateDatafiles(processIndex, dataFiles, dataDependencies, products, mainDependency, currentTimeFrame)
let propertyName = 'at' + timeFrameLabel.replace('-', '')
addProducs(propertyName)
addProducs(propertyName, products)
}
}
/* Single Files */
let dataFiles = multiTimeFrameDataFiles.get('Single Files')
let products = {}
{
let dataFiles = multiTimeFrameDataFiles.get('Single Files')
let products = {}
if (dataFiles !== undefined && dataFiles.size > 0) {
TS.projects.superalgos.functionLibraries.singleMarketFunctions.inflateDatafiles(processIndex, dataFiles, dataDependencies, products, mainDependency, currentTimeFrame)
if (dataFiles !== undefined && dataFiles.size > 0) {
TS.projects.superalgos.functionLibraries.singleMarketFunctions.inflateDatafiles(processIndex, dataFiles, dataDependencies, products, mainDependency, currentTimeFrame)
let propertyName = 'atAnyTimeFrame'
addProducs(propertyName)
let propertyName = 'atAnyTimeFrame'
addProducs(propertyName, products)
}
}
function addProducs(propertyName) {
function addProducs(propertyName, products) {
/*
The chart data structure allow users to simplify the syntax when they are using
the default exchange and the default market.
@@ -17,8 +17,8 @@ exports.newSuperalgosBotModulesTradingSimulation = function (processIndex) {
async function runSimulation(
chart,
exchange,
market,
exchange,
outputDatasetsMap,
writeFiles,
) {
@@ -152,7 +152,7 @@ exports.newSuperalgosBotModulesTradingSimulation = function (processIndex) {
chart,
exchange,
market
)
)
/*
Do the stuff needed previous to the run like
@@ -220,7 +220,7 @@ exports.newSuperalgosBotModulesTradingSimulation = function (processIndex) {
type: 'TS LF Trading Bot Info - Candle And Cycle',
placeholder: {}
}
contextInfo = {
candleIndex: tradingEngine.current.episode.candle.index.value,
cycle: tradingEngine.current.episode.cycle.value
@@ -368,6 +368,8 @@ exports.newSuperalgosBotModulesTradingSimulation = function (processIndex) {
let propertyName = 'at' + mapKey.replace('-', '')
let thisChart = chart[propertyName]
if (thisChart === undefined) { continue }
for (let k = 0; k < dataDependencies.length; k++) {
let dataDependencyNode = dataDependencies[k]
if (dataDependencyNode.referenceParent.config.codeName !== 'Multi-Period-Daily') { continue }
@@ -389,6 +391,8 @@ exports.newSuperalgosBotModulesTradingSimulation = function (processIndex) {
let propertyName = 'at' + mapKey.replace('-', '')
let thisChart = chart[propertyName]
if (thisChart === undefined) { continue }
for (let k = 0; k < dataDependencies.length; k++) {
let dataDependencyNode = dataDependencies[k]
if (dataDependencyNode.referenceParent.config.codeName !== 'Multi-Period-Market') { continue }
@@ -407,6 +411,8 @@ exports.newSuperalgosBotModulesTradingSimulation = function (processIndex) {
let propertyName = 'atAnyTimeFrame'
let thisChart = chart[propertyName]
if (thisChart === undefined) { return }
for (let k = 0; k < dataDependencies.length; k++) {
let dataDependencyNode = dataDependencies[k]
if (dataDependencyNode.referenceParent.config.codeName !== 'Single-File') { continue }
@@ -71,8 +71,8 @@ exports.newSuperalgosBotModulesTradingStages = function (processIndex) {
tradingEpisodeModuleObject = undefined
}
function updateChart(pChart) {
snapshotsModuleObject.updateChart(pChart)
function updateChart(pChart, pExchange, pMarket) {
snapshotsModuleObject.updateChart(pChart, pExchange, pMarket)
}
function mantain() {
@@ -169,7 +169,7 @@ exports.newSuperalgosBotModulesTradingSystem = function (processIndex) {
exchange = pExchange
market = pMarket
tradingStagesModuleObject.updateChart(pChart)
tradingStagesModuleObject.updateChart(pChart, pExchange, pMarket)
}
function buildDynamicIndicators() {