Compare commits

...
Author SHA1 Message Date
Luis Fernando Molina 0ece30c358 Merge pull request #446 from Superalgos/develop
Bug Fixes that impact MAC users doing the Tutorial
2021-01-22 12:52:21 +01:00
Luis Fernando Molina 9d947f0ca1 Merge pull request #445 from Luis-Fernando-Molina/develop
Contribution: Bug Fixed, Workspace tab not showing anything
2021-01-22 12:29:38 +01:00
Luis Fernando Molina d4a811a449 Bug Fixed, Workspace tab not showing anything 2021-01-22 12:28:47 +01:00
Julian Molina 3b736015cf Merge pull request #444 from julian-molina/develop
Welcome tutorial browser zoom on Mac step fix
2021-01-22 12:22:53 +01:00
Julian Molina d11f08ea33 This is my contribution to Superalgos 2021-01-22 12:21:02 +01:00
Luis Fernando Molina 6646632fe6 Merge pull request #443 from Luis-Fernando-Molina/develop
Contribution: Bug Fixed on repositioning at chart in charting space while zoomed if
2021-01-22 11:54:23 +01:00
Luis Fernando Molina 31bb098ff6 Bug Fixed on repositioning at chart in charting space while zoomed if 2021-01-22 11:53:57 +01:00
Luis Fernando Molina 85d9285eba Merge pull request #442 from Luis-Fernando-Molina/develop
Contribution: Process Error Handling Improved / UX Improved
2021-01-22 10:51:00 +01:00
Luis Fernando Molina 9f42d6bc11 Function not used 2021-01-22 10:50:10 +01:00
Luis Fernando Molina e63771b9ee Process Error Handling Improved / UX Improved 2021-01-22 10:46:47 +01:00
Luis Fernando Molina 97e2246601 Merge pull request #441 from Luis-Fernando-Molina/develop
Contribution: Bug Fixed on MAC OS not repositionig charts correctly during tutorial.
2021-01-22 09:42:43 +01:00
Luis Fernando Molina 4433ade3df Bug Fixed on MAC OS not repositionig charts correctly during tutorial. 2021-01-22 09:41:54 +01:00
Luis Fernando Molina ff54bfa142 Merge pull request #439 from Luis-Fernando-Molina/develop
Contribution: Bug Fixed, context menu not dissapearing when docs were closed
2021-01-22 07:37:37 +01:00
Luis Fernando Molina e72669ce61 Bug Fixed, context menu not dissapearing when docs were closed 2021-01-22 07:36:38 +01:00
Julian Molina ccc2c10606 Merge pull request #436 from julian-molina/develop
Contribution: Trading Engine Topic WIP
2021-01-21 21:30:49 +01:00
Julian Molina 8f3b6aa7e9 Trading Engine Topic WIP 2021-01-21 21:30:08 +01:00
Luis Fernando Molina 9e30cb8fcc Merge pull request #438 from Luis-Fernando-Molina/develop
Contribution: Improvements in Error Handlng / Error UX
2021-01-21 20:58:37 +01:00
Luis Fernando Molina 56e961ad01 Improvements in Error Handlng / Error UX 2021-01-21 20:57:45 +01:00
Julian Molina ae70226347 Trading Engine Topic WIP 2021-01-21 20:54:55 +01:00
Luis Fernando Molina 3a11c1e2b3 Improvemnts in error handling 2021-01-21 20:50:43 +01:00
Julian Molina 04d39bb111 Trading Engine Topic WIP 2021-01-21 20:17:43 +01:00
Luis Fernando Molina 6bb37ab10d Merge pull request #437 from Luis-Fernando-Molina/develop
Contribution: Bug Fixed Issue #318. Using # in the name of the trading system didn't show backtest results.
2021-01-21 20:15:47 +01:00
Luis Fernando Molina 3ea470bf60 Bug Fixed Issue #318. Using # in the name of the trading system didn't show backtest results. 2021-01-21 20:14:57 +01:00
Julian Molina 6d78112bc2 Trading Engine Topic WIP 2021-01-21 19:35:12 +01:00
Julian Molina 2508438889 Merge pull request #435 from julian-molina/develop
Contribution: User Manual Book
2021-01-21 18:20:46 +01:00
Julian Molina 22c91844da Merge branch 'develop' of https://github.com/julian-molina/Superalgos into develop 2021-01-21 14:59:44 +01:00
Julian Molina e0186e2ef7 User Manual Book WIP 2021-01-21 14:58:29 +01:00
Julian Molina 3536d2659a User Manual Book wip 2021-01-21 14:38:09 +01:00
Luis Fernando Molina e91610dc34 Merge pull request #433 from Superalgos/develop
Hot Fix to fix bug with Exchange Raw data during Live Trading
2021-01-21 14:15:13 +01:00
Luis Fernando Molina e80592530f Merge pull request #432 from Luis-Fernando-Molina/develop
Contribution: This is my contribution to Superalgos
2021-01-21 13:53:36 +01:00
Luis Fernando Molina 29614b9646 Bug Fixed with # in commit message 2021-01-21 13:52:44 +01:00
Luis Fernando Molina f8c6b40c7c Bug Fix 2021-01-21 13:38:27 +01:00
Luis Fernando Molina 1e1fa783ca Bug Fix 2021-01-21 13:33:07 +01:00
Julian Molina 590e9c4564 Merge pull request #2 from Superalgos/develop
Develop
2021-01-21 13:22:28 +01:00
Luis Fernando Molina e19ba0793c Merge pull request #429 from Luis-Fernando-Molina/develop
Contribution: Update Message updated
2021-01-20 17:40:46 +01:00
Luis Fernando Molina 9522b7b848 Update Message updated 2021-01-20 17:40:00 +01:00
Luis Fernando Molina 3904290bec Merge pull request #428 from Luis-Fernando-Molina/develop
Contribution: Bug Fixed: removing Github user requirement for app.update command.
2021-01-20 17:19:27 +01:00
Luis Fernando Molina 27734e85f4 Bug Fixed: removing Github user requirement for app.update command. 2021-01-20 17:18:38 +01:00
Luis Fernando Molina 2e3c667459 Merge pull request #427 from Luis-Fernando-Molina/develop
Contribution: Swithching Branches Error Handling Improved, with Docs and Placeholders
2021-01-20 16:38:58 +01:00
Luis Fernando Molina 5ae4d0aa5b Swithching Branches Error Handling Improved, with Docs and Placeholders 2021-01-20 16:38:06 +01:00
Luis Fernando Molina 24e140badb Merge pull request #426 from Luis-Fernando-Molina/develop
Contribution: Contribute Command Error Handling Improved with Docs and Placeholders
2021-01-20 16:10:25 +01:00
Luis Fernando Molina b6056f0d2e This is my contribution to Superalgos 2021-01-20 16:08:24 +01:00
Luis Fernando Molina ab595e6e31 This is my contribution to Superalgos 2021-01-20 16:05:29 +01:00
Luis Fernando Molina d910a83a30 This is my contribution to Superalgos 2021-01-20 16:03:10 +01:00
Luis Fernando Molina d9ab664a57 This is my contribution to Superalgos 2021-01-20 16:01:36 +01:00
Luis Fernando Molina 5d932ec16d This is my contribution to Superalgos 2021-01-20 15:53:17 +01:00
Luis Fernando Molina 3ca384e94f This is my contribution to Superalgos 2021-01-20 15:52:10 +01:00
Luis Fernando Molina aed93f3d21 This is my contribution to Superalgos 2021-01-20 15:51:26 +01:00
Luis Fernando Molina f013baaaec This is my contribution to Superalgos 2021-01-20 15:48:59 +01:00
Luis Fernando Molina 086db81331 This is my contribution to Superalgos 2021-01-20 15:47:36 +01:00
Luis Fernando Molina 7b1d627270 This is my contribution to Superalgos 2021-01-20 15:44:13 +01:00
Luis Fernando Molina 3a3bc2ae1b This is my contribution to Superalgos 2021-01-20 15:42:11 +01:00
Luis Fernando Molina eb1ad95d66 This is my contribution to Superalgos 2021-01-20 15:37:30 +01:00
Luis Fernando Molina 5a511d4d5d Merge pull request #425 from Luis-Fernando-Molina/develop
Contribution: Error Handling Improved for command app.update
2021-01-20 15:19:48 +01:00
Luis Fernando Molina ac891d603d Error Handling Improved for command app.update 2021-01-20 15:17:42 +01:00
Luis Fernando Molina c61db756d6 test update conflict 2021-01-20 15:09:52 +01:00
Luis Fernando Molina 22b5f95b6b test 2021-01-20 15:08:14 +01:00
Luis Fernando Molina eecb143ca9 Merge pull request #420 from 9808us/develop
Initial Italian Translation
2021-01-20 13:05:31 +01:00
Luis Fernando Molina 9c5f17ac51 Merge pull request #424 from julian-molina/master
Contribution: Getting started workspace fix
2021-01-20 12:54:26 +01:00
Julian Molina 709ac5ff24 Getting started workspace fix 2021-01-20 12:04:07 +01:00
9808us f6269c2ecd Merge branch 'develop' of https://github.com/Superalgos/Superalgos into develop 2021-01-16 15:16:16 +01:00
9808us b3563d24fe This is my contribution to Superalgos 2021-01-16 15:12:43 +01:00
40 changed files with 2015 additions and 502 deletions

No files matched your search

+2 -7
View File
@@ -62,11 +62,6 @@ margin-bottom: 0px;
margin-top: 0px;
border: 0px solid #cdcdcd;
padding: 5px;
/* DELETE candidate
margin: auto;
margin-right: 20px;
*/
}
.docs-table-cell{
@@ -817,7 +812,6 @@ padding-left: 180px;
margin-top: 20px;
}
.docs-search-results-header-tabs-container > input {
display: none;
}
@@ -858,7 +852,8 @@ display: none;
#tab4:checked ~ .docs-search-result-content #content4,
#tab5:checked ~ .docs-search-result-content #content5,
#tab6:checked ~ .docs-search-result-content #content6,
#tab7:checked ~ .docs-search-result-content #content7 {
#tab7:checked ~ .docs-search-result-content #content7,
#tab8:checked ~ .docs-search-result-content #content8 {
display: block;
}
+2 -2
View File
@@ -62,7 +62,7 @@
Jeff Braun, rico4dev, 9808us, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Norman,
Viktoria B., Guillermo V., Daniel J.,
Javier A., Gustavo J., Romina GS, Pedro P., Thais M., Andrey M., Loui M., Natalia M., Bashar A., Carlos V.,
Diego M.,
Diego M., CarnivalBen,
Sebastian E., Bogdan P., Marko V., Igor S., Niksa K., Rodrigo M., Nicanor M., Alejandro P., Mateo H., Lan
T., Leon A., Uroš R., Filip M., Vladimir J. and Pavle B.</p>
<p><span class="credits-red">With Superalgos Beta 8, contributing is easier than ever! Become a contributor!</span></p>
@@ -155,7 +155,7 @@
</div>
<div class="menu-row">
<div class="menu-item" onClick="window.contextMenu.toPlaceholder()">
<img src="Icons/Superalgos/bitcoin.png" class="menu-img" title="Placeholder">
<img src="Icons/Superalgos/docs-placeholder-style.png" class="menu-img" title="Placeholder">
</div>
<div class="menu-item" onClick="window.contextMenu.toSummary()">
<img src="Icons/Superalgos/docs-summary-style.png" class="menu-img" title="Summary">
+110 -22
View File
@@ -590,21 +590,50 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
switch (requestParameters[2]) { // switch by command
case 'Contribute': {
try {
const commitMessage = unescape(requestParameters[3])
let commitMessage = unescape(requestParameters[3])
const username = unescape(requestParameters[4])
const token = unescape(requestParameters[5])
const currentBranch = unescape(requestParameters[6])
const contributionsBranch = unescape(requestParameters[7])
let error
/* Unsavping # */
for (let i = 0; i < 10; i++) {
commitMessage = commitMessage.replace('_SLASH_', '/')
commitMessage = commitMessage.replace('_HASHTAG_', '#')
}
contribute()
async function contribute() {
if (await doGit() === false) {
respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), httpResponse)
await doGit()
if (error !== undefined) {
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'App Error - Contribution Not Sent',
anchor: undefined,
placeholder: {}
}
respondWithDocsObject(docs, error)
return
}
if (await doGithub() === false) {
respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), httpResponse)
await doGithub()
if (error !== undefined) {
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'App Error - Contribution Not Sent',
anchor: undefined,
placeholder: {}
}
console.log('respond with docs ')
respondWithDocsObject(docs, error)
return
}
respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse)
@@ -623,14 +652,13 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
await git.add('./*')
await git.commit(commitMessage)
await git.push('origin', currentBranch)
return true
} catch (err) {
console.log('[ERROR] httpInterface -> App -> Contribute -> doGit -> Method call produced an error.')
console.log('[ERROR] httpInterface -> App -> Contribute -> doGit -> err.stack = ' + err.stack)
console.log('[ERROR] httpInterface -> App -> Contribute -> doGit -> commitMessage = ' + commitMessage)
console.log('[ERROR] httpInterface -> App -> Contribute -> doGit -> currentBranch = ' + currentBranch)
console.log('[ERROR] httpInterface -> App -> Contribute -> doGit -> contributionsBranch = ' + contributionsBranch)
return false
error = err
}
}
@@ -657,20 +685,19 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
head,
base,
});
return true
} catch (err) {
if (err.stack.indexOf('A pull request already exists') >= 0) {
return true
return
} else {
console.log('[ERROR] httpInterface -> App -> Contribute -> doGithub -> Method call produced an error.')
console.log('[ERROR] httpInterface -> App -> Contribute -> doGithub -> err.stack = ' + err.stack)
console.log('[ERROR] httpInterface -> App -> Contribute -> doGithub -> commitMessage = ' + commitMessage)
console.log('[ERROR] httpInterface -> App -> Contribute -> doGithub -> username = ' + username)
console.log('[ERROR] httpInterface -> App -> Contribute -> doGithub -> token starts with = ' + token.substring(0, 10) + '...')
console.log('[ERROR] httpInterface -> App -> Contribute -> doGithub -> token starts with = ' + token.substring(0, 10) + '...')
console.log('[ERROR] httpInterface -> App -> Contribute -> doGithub -> token ends with = ' + '...' + token.substring(token.length - 10))
console.log('[ERROR] httpInterface -> App -> Contribute -> doGithub -> currentBranch = ' + currentBranch)
console.log('[ERROR] httpInterface -> App -> Contribute -> doGithub -> contributionsBranch = ' + contributionsBranch)
return false
error = err
}
}
}
@@ -693,22 +720,33 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
}
break
}
case 'Update': {
try {
const currentBranch = unescape(requestParameters[3])
update()
async function update() {
let message = await doGit()
let result = await doGit()
if (message !== undefined) {
if (result.error === undefined) {
let customResponse = {
result: global.CUSTOM_OK_RESPONSE.result,
message: message
message: result.message
}
respondWithContent(JSON.stringify(customResponse), httpResponse)
} else {
respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), httpResponse)
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'App Error - Update Failed',
anchor: undefined,
placeholder: {}
}
respondWithDocsObject(docs, result.error)
}
}
@@ -724,10 +762,11 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
let message
try {
message = await git.pull('https://github.com/Superalgos/Superalgos', currentBranch)
return message
return { message: message }
} catch (err) {
console.log('[ERROR] Error updating ' + currentBranch)
console.log(err.stack)
return { error: err }
}
}
@@ -751,15 +790,25 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
case 'Checkout': {
try {
const currentBranch = unescape(requestParameters[3])
let error
checkout()
async function checkout() {
let result = await doGit()
await doGit()
if (result === true) {
if (error === undefined) {
respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse)
} else {
respondWithContent(JSON.stringify(global.DEFAULT_FAIL_RESPONSE), httpResponse)
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'Switching Branches - Current Branch Not Changed',
anchor: undefined,
placeholder: {}
}
respondWithDocsObject(docs, error)
}
}
@@ -776,9 +825,8 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
} catch (err) {
console.log('[ERROR] Error changing current branch to ' + currentBranch)
console.log(err.stack)
return false
error = err
}
return true
}
} catch (err) {
@@ -798,6 +846,41 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
break
}
}
function respondWithDocsObject(docs, error) {
if (error.message !== undefined) {
docs.placeholder.errorMessage = {
style: 'Error',
text: error.message
}
}
if (error.stack !== undefined) {
docs.placeholder.errorStack = {
style: 'Javascript',
text: error.stack
}
}
if (error.code !== undefined) {
docs.placeholder.errorCode = {
style: 'Json',
text: error.code
}
}
docs.placeholder.errorDetails = {
style: 'Json',
text: JSON.stringify(error, undefined, 4)
}
let customResponse = {
result: global.CUSTOM_FAIL_RESPONSE.result,
docs: docs
}
respondWithContent(JSON.stringify(customResponse), httpResponse)
}
}
break
@@ -1267,7 +1350,12 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
case 'Storage':
{
respondWithFile(global.env.PATH_TO_DATA_STORAGE + '/' + httpRequest.url.substring(9), httpResponse)
let pathToFile = httpRequest.url.substring(9)
/* Unsavping # */
for (let i = 0; i < 10; i++) {
pathToFile = pathToFile.replace('_HASHTAG_', '#')
}
respondWithFile(global.env.PATH_TO_DATA_STORAGE + '/' + pathToFile, httpResponse)
}
break
@@ -1 +1 @@
{"type":"Workspace","name":"Getting Started","rootNodes":[{"type":"Network","name":"My Network","project":"Superalgos","networkNodes":[{"type":"Network Node","name":"My Computer","config":"{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"18041\"\n}","project":"Superalgos","dataTasks":{"type":"Data Tasks","name":"New Data Tasks","project":"Superalgos","projectDataTasks":[{"type":"Project Data Tasks","name":"Superalgos","project":"Superalgos","exchangeDataTasks":[{"type":"Exchange Data Tasks","name":"Binance","project":"Superalgos","marketDataTasks":[{"type":"Market Data Tasks","name":"Binance BTC/USDT","project":"Superalgos","dataMineTasks":[{"type":"Data Mine Tasks","name":"Masters","project":"Superalgos","taskManagers":[{"type":"Task Manager","name":"Masters","project":"Superalgos","tasks":[{"type":"Task","name":"Exchange Raw Data","project":"Superalgos","bot":{"type":"Sensor Bot Instance","name":"Exchange Raw Data","config":"{ \n\"startDate\": \"2020-01-01\"\n}","project":"Superalgos","processes":[{"type":"Sensor Process Instance","name":"Exchange Raw Data Historic-OHLCVs","project":"Superalgos","id":"d244c564-4e86-43c7-9796-dc3b6294ec8b","savedPayload":{"position":{"x":23490.023749611923,"y":29239.135911211026},"targetPosition":{"x":23779.801497498644,"y":29316.781624741783},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Historic-OHLCVs","id":"5eb11d6a-022e-4f60-97c4-d6cf90b249dc"}}}],"id":"343313ae-5705-484d-8bf8-aed25ba61cfa","savedPayload":{"position":{"x":23779.801497498644,"y":29316.781624741783},"targetPosition":{"x":24069.579245385365,"y":29394.42733827254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"a8f38508-1cac-4ab1-815f-d338fc813377","savedPayload":{"position":{"x":24069.579245385365,"y":29394.42733827254},"targetPosition":{"x":24359.356993272086,"y":29472.073051803298},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Task","name":"Candles Volumes","project":"Superalgos","bot":{"type":"Indicator Bot Instance","name":"Candles Volumes","config":"{}","project":"Superalgos","processes":[{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Market","project":"Superalgos","id":"f0ef12ed-f0fd-4b88-8e15-27cf24265a5f","savedPayload":{"position":{"x":23799.549372136753,"y":28802.457809532632},"targetPosition":{"x":24059.356993272086,"y":28952.457809532632},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","id":"9f683143-a33f-42c1-9fa8-c601f01ee4e1"}}},{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Daily","project":"Superalgos","id":"7c8b312c-09bf-4c59-853f-1592391a9c57","savedPayload":{"position":{"x":24059.356993272086,"y":28652.457809532632},"targetPosition":{"x":24059.356993272086,"y":28952.457809532632},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Daily","id":"980ceb1d-7be6-454f-90d9-01ba1fd4a65d"}}}],"id":"8d58e84b-d7ef-464f-8079-0ec0887e3da3","savedPayload":{"position":{"x":24059.356993272086,"y":28952.457809532632},"targetPosition":{"x":24209.356993272086,"y":29212.265430667965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"bf29e3bd-9386-408b-9091-042da0c53e81","savedPayload":{"position":{"x":24209.356993272086,"y":29212.265430667965},"targetPosition":{"x":24359.356993272086,"y":29472.073051803298},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Task","name":"Resistances and Supports","project":"Superalgos","bot":{"type":"Indicator Bot Instance","name":"Resistances and Supports","config":"{}","project":"Superalgos","processes":[{"type":"Indicator Process Instance","name":"Resistances and Supports Multi-Period-Market","project":"Superalgos","id":"a707814e-b81b-4102-9b5b-4e2fe969324f","savedPayload":{"position":{"x":24437.002706802843,"y":28602.739808143135},"targetPosition":{"x":24514.6484203336,"y":28892.517556029856},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"refeLine truncated
{"type":"Workspace","name":"Getting Started","rootNodes":[{"type":"Network","name":"My Network","project":"Superalgos","networkNodes":[{"type":"Network Node","name":"My Computer","config":"{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"18041\"\n}","project":"Superalgos","dataTasks":{"type":"Data Tasks","name":"New Data Tasks","project":"Superalgos","projectDataTasks":[{"type":"Project Data Tasks","name":"Superalgos","project":"Superalgos","exchangeDataTasks":[{"type":"Exchange Data Tasks","name":"Binance","project":"Superalgos","marketDataTasks":[{"type":"Market Data Tasks","name":"Binance BTC/USDT","project":"Superalgos","dataMineTasks":[{"type":"Data Mine Tasks","name":"Masters","project":"Superalgos","taskManagers":[{"type":"Task Manager","name":"Masters","project":"Superalgos","tasks":[{"type":"Task","name":"Exchange Raw Data","project":"Superalgos","bot":{"type":"Sensor Bot Instance","name":"Exchange Raw Data","config":"{ \n\"startDate\": \"2020-01-01\"\n}","project":"Superalgos","processes":[{"type":"Sensor Process Instance","name":"Exchange Raw Data Historic-OHLCVs","project":"Superalgos","id":"d244c564-4e86-43c7-9796-dc3b6294ec8b","savedPayload":{"position":{"x":23490.023749611923,"y":29239.135911211026},"targetPosition":{"x":23779.801497498644,"y":29316.781624741783},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Historic-OHLCVs","id":"5eb11d6a-022e-4f60-97c4-d6cf90b249dc"}}}],"id":"343313ae-5705-484d-8bf8-aed25ba61cfa","savedPayload":{"position":{"x":23779.801497498644,"y":29316.781624741783},"targetPosition":{"x":24069.579245385365,"y":29394.42733827254},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"a8f38508-1cac-4ab1-815f-d338fc813377","savedPayload":{"position":{"x":24069.579245385365,"y":29394.42733827254},"targetPosition":{"x":24359.356993272086,"y":29472.073051803298},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Task","name":"Candles Volumes","project":"Superalgos","bot":{"type":"Indicator Bot Instance","name":"Candles Volumes","config":"{}","project":"Superalgos","processes":[{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Market","project":"Superalgos","id":"f0ef12ed-f0fd-4b88-8e15-27cf24265a5f","savedPayload":{"position":{"x":23799.549372136753,"y":28802.457809532632},"targetPosition":{"x":24059.356993272086,"y":28952.457809532632},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Market","id":"9f683143-a33f-42c1-9fa8-c601f01ee4e1"}}},{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Daily","project":"Superalgos","id":"7c8b312c-09bf-4c59-853f-1592391a9c57","savedPayload":{"position":{"x":24059.356993272086,"y":28652.457809532632},"targetPosition":{"x":24059.356993272086,"y":28952.457809532632},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"referenceParent":{"type":"Process Definition","name":"Multi-Period-Daily","id":"980ceb1d-7be6-454f-90d9-01ba1fd4a65d"}}}],"id":"8d58e84b-d7ef-464f-8079-0ec0887e3da3","savedPayload":{"position":{"x":24059.356993272086,"y":28952.457809532632},"targetPosition":{"x":24209.356993272086,"y":29212.265430667965},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"id":"bf29e3bd-9386-408b-9091-042da0c53e81","savedPayload":{"position":{"x":24209.356993272086,"y":29212.265430667965},"targetPosition":{"x":24359.356993272086,"y":29472.073051803298},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Task","name":"Resistances and Supports","project":"Superalgos","bot":{"type":"Indicator Bot Instance","name":"Resistances and Supports","config":"{}","project":"Superalgos","processes":[{"type":"Indicator Process Instance","name":"Resistances and Supports Multi-Period-Market","project":"Superalgos","id":"a707814e-b81b-4102-9b5b-4e2fe969324f","savedPayload":{"position":{"x":24437.002706802843,"y":28602.739808143135},"targetPosition":{"x":24514.6484203336,"y":28892.517556029856},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"refeLine truncated
@@ -35,6 +35,29 @@
"text": "VI->Superalgos->Topic->Trading Logic->While the framework proposed by trading systems and trading strategies carry a fair bit of trading logic in and of themselves, it is how you define market situations along with the instructions passed to the Trading Bot that determine how strategies work.",
"updated": 1610310832197
},
{
"style": "Chapter",
"text": "VII->Superalgos->Topic->Low-Frequency Trading Bot->In Superalgos, the Trading Bot plays no part in the definition of the trading logic. Instead, it is the program that executes the trading logic, interacts with the exchange, and keeps track of orders.",
"updated": 1611236020198
},
{
"style": "Chapter",
"text": "VIII->Superalgos->Topic->Order Management->One of the crucial aspects of trading automation is the management of orders. The system operates with assumptions that must be verified and synchronized with the exchange. Learning how the Low-Frequency Trading Bot manages orders will help you understand the life cycle of orders and how your definitions in the Open Stage and the Close Stage affect the results.",
"updated": 1611237227549
},
{
"style": "Text",
"text": ""
},
{
"style": "Chapter",
"text": "IX->Superalgos->Topic->Trading Engine->The trading engine is about making the data processed by the Trading Bot accessible. Use it while debugging strategies to visually track every piece of information processed by the trading bot at any point in time. Use it from within trading systems to feed strategies with the details of what happens at runtime.",
"updated": 1611260954268
},
{
"style": "Text",
"text": ""
},
{
"style": "Text",
"text": "Work in Progress"
@@ -50,6 +73,10 @@
{
"style": "Text",
"text": "Work in Progress"
},
{
"style": "Text",
"text": ""
}
]
}
@@ -24,6 +24,26 @@
"text": "Dummy",
"updated": 1610121260808
},
{
"style": "Title",
"text": "Note for Hierarchy Tables No Discussion",
"updated": 1611254828783
},
{
"style": "Block",
"text": "Note for Hierarchy Tables No Discussion",
"updated": 1611254840023
},
{
"style": "Note",
"text": "Click on any of the nodes to get the details, including particulars on their configuration, when applicable.",
"updated": 1611254904577
},
{
"style": "Block",
"text": "Dummy",
"updated": 1611254890702
},
{
"style": "Title",
"text": "Important for Live Sessions"
@@ -9,8 +9,77 @@
"paragraphs": [
{
"style": "Text",
"text": "Check for the Client's console for details on what may have happened. After you fix the issue that prevented the App Contribute Command to run, you may try again.",
"updated": 1611129009743
"text": "Check the following section for details on what may have happened. After you fix the issue that prevented the App Contribute Command to run, you may try again.",
"updated": 1611152997869
},
{
"style": "Title",
"text": "Error Info",
"updated": 1611154606702
},
{
"style": "Text",
"text": "In the following section you will find the specific information received when this error occured."
},
{
"style": "Note",
"text": "You will only see it if you opened this page as a result of the error actually happening.",
"updated": 1611153032408
},
{
"style": "Subtitle",
"text": "Error Message"
},
{
"style": "Text",
"text": "The following is the Error Message of the Exception that occured at the Client:"
},
{
"style": "Placeholder",
"text": "errorMessage"
},
{
"style": "Subtitle",
"text": "Error Stack"
},
{
"style": "Text",
"text": "The following is the Error Stack of the Exception that occured at the Client:"
},
{
"style": "Placeholder",
"text": "errorStack"
},
{
"style": "Subtitle",
"text": "Error Code"
},
{
"style": "Text",
"text": "The follwing is the Error Code of the Exception that occured at the Client:"
},
{
"style": "Placeholder",
"text": "errorCode"
},
{
"style": "Subtitle",
"text": "Error Details",
"updated": 1611154543778
},
{
"style": "Text",
"text": "The follwing are all the Error details of the Exception that occured at the Client:",
"updated": 1611154675224
},
{
"style": "Placeholder",
"text": "errorDetails",
"updated": 1611154555419
},
{
"style": "Text",
"text": ""
}
]
}
@@ -9,8 +9,77 @@
"paragraphs": [
{
"style": "Success",
"text": "Check for the Client's console for details on what may have happened. After you fix the issue, you may try again.",
"updated": 1611129360143
"text": "Check for the following section for details on what may have happened. After you fix the issue, you may try again.",
"updated": 1611152967185
},
{
"style": "Title",
"text": "Error Info",
"updated": 1611154641024
},
{
"style": "Text",
"text": "In the following section you will find the specific information received when this error occured."
},
{
"style": "Note",
"text": "You will only see it if you opened this page as a result of the error actually happening.",
"updated": 1611151375974
},
{
"style": "Subtitle",
"text": "Error Message"
},
{
"style": "Text",
"text": "The following is the Error Message of the Exception that occured at the Client:",
"updated": 1611151299633
},
{
"style": "Placeholder",
"text": "errorMessage"
},
{
"style": "Subtitle",
"text": "Error Stack"
},
{
"style": "Text",
"text": "The following is the Error Stack of the Exception that occured at the Client:",
"updated": 1611151427220
},
{
"style": "Placeholder",
"text": "errorStack"
},
{
"style": "Subtitle",
"text": "Error Code"
},
{
"style": "Text",
"text": "The follwing is the Error Code of the Exception that occured at the Client:",
"updated": 1611151443562
},
{
"style": "Placeholder",
"text": "errorCode"
},
{
"style": "Subtitle",
"text": "Error Details"
},
{
"style": "Text",
"text": "The follwing are all the Error details of the Exception that occured at the Client:"
},
{
"style": "Placeholder",
"text": "errorDetails"
},
{
"style": "Text",
"text": ""
}
]
}
@@ -9,8 +9,12 @@
"paragraphs": [
{
"style": "Success",
"text": "You now have the latest version of Superalgos. Just remeber to restart the Client and the UI.",
"updated": 1610454408134
"text": "You now have the latest version of Superalgos. Just remeber to restart the Client and the UI. If you have Tasks running, you should first stop the tasks, and then restart the Client, so that you can run those task again using the updated codebase.",
"updated": 1611160648343
},
{
"style": "Note",
"text": "The update you made, only afffects the Client which you are connected to via http using your browser. If you have more Clients running as part of a Network, you will need to update them too, etither manually using Git or by navigating with your browser to their URL and doing running the App Update Command there."
}
]
}
@@ -7,10 +7,75 @@
"updated": 1610543788194
},
"paragraphs": [
{
"style": "Text",
"text": "More detailed info of what caused this failure to switch can be found below.",
"updated": 1611155878425
},
{
"style": "Title",
"text": "Error Info"
},
{
"style": "Text",
"text": "In the following section you will find the specific information received when this error occured."
},
{
"style": "Note",
"text": "More detailed info of what caused this failure to switch can be find at the Client's Console.",
"updated": 1610543823314
"text": "You will only see it if you opened this page as a result of the error actually happening.",
"updated": 1611155956953
},
{
"style": "Subtitle",
"text": "Error Message"
},
{
"style": "Text",
"text": "The following is the Error Message of the Exception that occured at the Client:"
},
{
"style": "Placeholder",
"text": "errorMessage"
},
{
"style": "Subtitle",
"text": "Error Stack"
},
{
"style": "Text",
"text": "The following is the Error Stack of the Exception that occured at the Client:"
},
{
"style": "Placeholder",
"text": "errorStack"
},
{
"style": "Subtitle",
"text": "Error Code"
},
{
"style": "Text",
"text": "The follwing is the Error Code of the Exception that occured at the Client:"
},
{
"style": "Placeholder",
"text": "errorCode"
},
{
"style": "Subtitle",
"text": "Error Details"
},
{
"style": "Text",
"text": "The follwing are all the Error details of the Exception that occured at the Client:"
},
{
"style": "Placeholder",
"text": "errorDetails"
},
{
"style": "Text",
"text": ""
}
]
}
@@ -3,25 +3,60 @@
"pageNumber": "4",
"type": "Docs In Italian",
"definition": {
"text": "The Docs articles are fully written in English. The system allow users to search / browse articles in other languages as well, as long as other users contribute translations."
"text": "The Docs articles are fully written in English. The system allow users to search / browse articles in other languages as well, as long as other users contribute translations.",
"translations": [
{
"language": "IT",
"text": "La guida di Superalgos è scritta interamente in inglese ma anche tu puoi aiutare a tradurre nella tua lingua preferita. Il sistema attualmente consente agli utenti di cercare o sfogliare la guida anche in altre lingue purché altri utenti contribuiscano alle traduzioni.",
"updated": 1610794887971
}
]
},
"paragraphs": [
{
"style": "Text",
"text": "Superalgos and any other integrated project are written in English, since English is considered the default language. Node types, variable names, etc., all is originally in English language. "
"text": "Superalgos and any other integrated project are written in English, since English is considered the default language. Node types, variable names, etc., all is originally in English language. ",
"translations": [
{
"language": "IT",
"text": "Superalgos e gli altri progetti integrati sono scritti in inglese perchè considerata la lingua predefinita. Tipi di nodi, nomi di variabili, ecc., Tutto è originariamente in lingua inglese.",
"updated": 1610806159263
}
]
},
{
"style": "Text",
"text": "The Docs content can be translated by anyone willing to contribute some time doing so. That helps users to read the contents of the Docs in their native language. "
"text": "The Docs content can be translated by anyone willing to contribute some time doing so. That helps users to read the contents of the Docs in their native language. ",
"translations": [
{
"language": "IT",
"text": "Il contenuto della guida può essere tradotto da chiunque desideri contribuire! Così facendo aiuterai gli utenti a leggere i contenuti della guida nella loro lingua madre e tu potrai dare il tuo contributo.",
"updated": 1610806232380
}
]
},
{
"style": "Success",
"text": " Users can switch between languages using the links provided at the footer of every page at the Docs. ",
"updated": 1609085068937
"updated": 1609085068937,
"translations": [
{
"language": "IT",
"text": "Gli utenti possono passare da una lingua all'altra utilizzando i collegamenti che si trovano nel footer di ogni pagina in questa guida.",
"updated": 1610806272356
}
]
},
{
"style": "Note",
"text": "You can only add or delete pages to the Docs if you are navigating it in English, because English is the default language, and from there pages are later translated. "
"text": "You can only add or delete pages to the Docs if you are navigating it in English, because English is the default language, and from there pages are later translated. ",
"translations": [
{
"language": "IT",
"text": "Puoi aggiungere o eliminare le pagine della guida solo se stai navigando in inglese perché è la lingua predefinita e da lì le pagine possono essere tradotte in seguito.",
"updated": 1610806324698
}
]
}
]
}
@@ -0,0 +1,32 @@
{
"topic": "Low-Frequency Trading Bot",
"pageNumber": "3",
"type": "Data Products Visualization",
"definition": {
"text": "The Superalgos trading bot outputs several data products which may be visualized on the frontend application in multiple manners.",
"updated": 1611240250659
},
"paragraphs": [
{
"style": "Text",
"text": "The Low-Frequency trading bot outputs tens of data products, which are made available for others to use through the data structure provided by the Trading Engine hierarchy, the Trading System involved in the trading session, and the time machines installed to visualize the trading simulations.",
"updated": 1611252948830
},
{
"style": "Success",
"text": "The Trading Bot Layers interactive tutorial available in the Weak-Hands Buster v.2 plugin workspace covers all the trading bot features that enable the visualization of trading information:"
},
{
"style": "List",
"text": "Visualization of simulations over the chart for all types of trading sessions."
},
{
"style": "List",
"text": "Visualization of all the trading information managed by the trading bot on the trading engine hierarchy."
},
{
"style": "List",
"text": "Visualization of event highlights, values, warnings, errors, and general information concerning the trading system."
}
]
}
@@ -0,0 +1,24 @@
{
"topic": "Trading Engine",
"pageNumber": "1",
"type": "Trading Engine Hierarchy",
"definition": {
"text": "The trading engine provides a feedback loop to trading systems so that your strategies may leverage the information processed by the trading bot.",
"updated": 1611253515308
},
"paragraphs": [
{
"style": "Include",
"text": "Superalgos->Node->Trading Engine->Definition",
"updated": 1611253576142
},
{
"style": "Include",
"text": "Superalgos->Node->Trading Engine->Content"
},
{
"style": "Success",
"text": "The trading engine hierarchy is deep and large, with many ramifications. It is best to learn it through hands-on experimentation, by testing an existing trading system."
}
]
}
@@ -0,0 +1,68 @@
{
"topic": "Trading Engine",
"pageNumber": "2",
"type": "Monitoring Runtime Data",
"definition": {
"text": "Use the trading engine hierarchy to track every piece of information processed by the trading bot, candle by candle.",
"updated": 1611253725593
},
"paragraphs": [
{
"style": "Text",
"text": "The trading engine hierarchy is a portal into the trading bot’s machine room—the brain. Think of the trading engine as a terminal connected to each of the brain’s neurons, taking a snapshot for every candle, and registering with precision every piece of data handled by the trading bot during the trading session.",
"updated": 1611253749127
},
{
"style": "Text",
"text": "Superalgos combines the time navigation features of the charts with the visual environment representing data structures of the design space, to create an immersive user experience."
},
{
"style": "Callout",
"text": "Each of the nodes in the hierarchy may display its value on the design space, right below the icon representing the node, for each candle."
},
{
"style": "Note",
"text": "How users may monitor the information featured in the Trading Engine hierarchy is explained and demonstrated on the Trading Bot Layers tutorial available on the Weak-hands Buster V2.0 plugin workspace.",
"updated": 1611253775463
},
{
"style": "Text",
"text": "As a quick refresher, the process is more or less as follows:"
},
{
"style": "List",
"text": "Run a trading session. Start with a backtest, so that you may get a quick feel of how the Trading Engine hierarchy displays data spanning any period.",
"updated": 1611253817389
},
{
"style": "List",
"text": "Go to the chart displaying the simulation and find one of the positions.",
"updated": 1611253824254
},
{
"style": "List",
"text": "Turn on the Current Position layer in the Trading Engine layer manager. This layer monitors the position structure of nodes under the current node, that is, the information regarding current positions.",
"updated": 1611253835635
},
{
"style": "List",
"text": "Split the screen to make room for both the design space and the charting space.",
"updated": 1611253840769
},
{
"style": "List",
"text": "Position the view on the design space so that you may see the corresponding structure of nodes.",
"updated": 1611253852074
},
{
"style": "List",
"text": "Slide the pointer of the mouse over the charts, across the position, and notice how the values for each node displayed on the design space change. Each node displays the corresponding value for each candle.",
"updated": 1611253859589
},
{
"style": "Success",
"text": "Much of the data handled by the trading engine may also be visualized over the charts through the layers and panels in the Trading Charts layer manager. If any of the above is not clear, please refer to the Trading Bot Layers Tutorial available on the Weak-hands Buster V2.0 plugin workspace.",
"updated": 1611253891479
}
]
}
@@ -0,0 +1,28 @@
{
"topic": "Trading Engine",
"pageNumber": "3",
"type": "Trading Bot Output",
"definition": {
"text": "The trading bot stores every piece of information processed in files, making all data accessible to others, both online and offline.",
"updated": 1611254037722
},
"paragraphs": [
{
"style": "Text",
"text": "As explained elsewhere, the trading bot makes the information it processes available to users through the hierarchy of the trading engine, which may be visualized both on the design space and over the charts. It also makes it available to trading systems.",
"updated": 1611254053601
},
{
"style": "Text",
"text": "On top of that, the information is also stored in files, sorted by concept. These makes the runtime information available to other processes and external systems, to be accessed both online, that is, at runtime, of offline."
},
{
"style": "Text",
"text": "The trading bot outputs files on the node it runs on, particularly, in the following location:"
},
{
"style": "Json",
"text": "Data Storage > [Exchange] > [Market] > Masters-Trading > Low-Frequency > Output > [Session] > Concept > Multi-Period-[Daily/Market] > Time Frame"
}
]
}
@@ -0,0 +1,76 @@
{
"topic": "Trading Engine",
"pageNumber": "4",
"type": "Temporal Context - Current and Last",
"definition": {
"text": "Much of the information provided by the trading engine may be accessed for the current instance of the object as well as for the last instance that was open, at any point in time.",
"updated": 1611254206670
},
"paragraphs": [
{
"style": "Text",
"text": "The trading engine hierarchy is organized by context. That is, the main offspring nodes—current, last, and exchange orders—describe the context in which their respective offspring live.",
"updated": 1611254225764
},
{
"style": "Text",
"text": "For example, the concept of an episode—a whole run of the trading bot— exists only in the context of the current episode, as the system keeps track of one episode at the time only."
},
{
"style": "Text",
"text": "However, the concept of a position is tracked both as the current position and the last position. This is possible because the system keeps track of all positions occurring within an episode."
},
{
"style": "Callout",
"text": "Superalgos developers thought it was worth it to provide certain information, positions, for example, in both contexts, as this allows you—visually—and your trading system—using simple syntax—to access information about the current position and the last position at any given point in time."
},
{
"style": "Title",
"text": "Current",
"updated": 1611254496763
},
{
"style": "Include",
"text": "Superalgos->Node->Current->Definition",
"updated": 1611254540559
},
{
"style": "Include",
"text": "Superalgos->Node->Current->Content"
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion",
"updated": 1611255184563
},
{
"style": "Hierarchy",
"text": "Superalgos->Current->2",
"updated": 1611254736085
},
{
"style": "Title",
"text": "Last",
"updated": 1611254547170
},
{
"style": "Include",
"text": "Superalgos->Node->Last->Definition",
"updated": 1611254556715
},
{
"style": "Include",
"text": "Superalgos->Node->Last->Content"
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion",
"updated": 1611255197793
},
{
"style": "Hierarchy",
"text": "Superalgos->Last->2",
"updated": 1611255233693
}
]
}
@@ -0,0 +1,239 @@
{
"topic": "Trading Engine",
"pageNumber": "5",
"type": "Conceptual Context - Episode, Strategy, Position, Strategy Stages",
"definition": {
"text": "Track the properties within each of the major concepts handled by the trading bot, such as episodes, strategies, positions, strategy stages, and exchange orders.",
"updated": 1611256914210
},
"paragraphs": [
{
"style": "Text",
"text": "Episodes, strategies, positions, strategy stages, exchange orders, and other concepts may be seen as different contexts too, although not of the temporal kind.",
"updated": 1611256927199
},
{
"style": "Text",
"text": "For instance, you may want to know what the ROI is in the context of the episode—that is, the ROI after several positions have passed—or the ROI of the current position only."
},
{
"style": "Callout",
"text": "In other words, many properties such as performance metrics—like ROI, or profit loss—or market data—like the begin and end datetimes or any of these concepts—exist in more than one conceptual context."
},
{
"style": "Text",
"text": "The following pages describe each of these major conceptual contexts, which, in turn, may exist in more than one temporal context."
},
{
"style": "Note",
"text": "From the perspective of systems design, each of these concepts is handled as an object that may be open or closed, thus has a lifespan. The same object may be open more than once, but only after the previous instance has been closed.",
"updated": 1611256963378
},
{
"style": "Title",
"text": "Episode",
"updated": 1611257045974
},
{
"style": "Include",
"text": "Superalgos->Node->Episode->Definition",
"updated": 1611257060021
},
{
"style": "Include",
"text": "Superalgos->Node->Episode->Content",
"updated": 1611257063548
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Episode->2",
"updated": 1611257076886
},
{
"style": "Text",
"text": ""
},
{
"style": "Title",
"text": "Strategy",
"updated": 1611257279919
},
{
"style": "Text",
"text": ""
},
{
"style": "Include",
"text": "Superalgos->Node->Strategy->Definition",
"updated": 1611257297317
},
{
"style": "Include",
"text": "Superalgos->Node->Strategy->Content",
"updated": 1611257300492
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Strategy->2",
"updated": 1611257312551
},
{
"style": "Title",
"text": "Position",
"updated": 1611257347308
},
{
"style": "Include",
"text": "Superalgos->Node->Position->Definition",
"updated": 1611257358664
},
{
"style": "Include",
"text": "Superalgos->Node->Position->Content",
"updated": 1611257362447
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Position->2",
"updated": 1611257376163
},
{
"style": "Title",
"text": "Strategy Stages",
"updated": 1611257433526
},
{
"style": "Text",
"text": "The Superalgos Protocol implements a trading framework by which strategies within a trading system are described in stages. The trading bot uses these definitions during runtime.",
"updated": 1611257532139
},
{
"style": "Text",
"text": "The concept of strategy stages in the context of the trading engine is an extension of the original concept, useful to keep track of the activity of the trading bot and organize the information processed during runtime."
},
{
"style": "Text",
"text": "Use these sections of the trading engine if you wish to track exactly what is going on, at a granular level, step by step, from the instant a strategy is triggered until it is closed, with the information segregated by strategy stage."
},
{
"style": "Callout",
"text": "The exercise may be particularly useful to grasp the intricacies of the workings of the trading bot or to research particular behaviors."
},
{
"style": "Subtitle",
"text": "Strategy Trigger Stage",
"updated": 1611257553903
},
{
"style": "Include",
"text": "Superalgos->Node->Strategy Trigger Stage->Definition",
"updated": 1611257563170
},
{
"style": "Include",
"text": "Superalgos->Node->Strategy Trigger Stage->Content",
"updated": 1611257566539
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Strategy Trigger Stage->2",
"updated": 1611257598667
},
{
"style": "Text",
"text": ""
},
{
"style": "Subtitle",
"text": "Strategy Open Stage",
"updated": 1611257613573
},
{
"style": "Include",
"text": "Superalgos->Node->Strategy Open Stage->Definition",
"updated": 1611257617299
},
{
"style": "Include",
"text": "Superalgos->Node->Strategy Open Stage->Content",
"updated": 1611257621534
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Strategy Open Stage->3",
"updated": 1611257686884
},
{
"style": "Text",
"text": ""
},
{
"style": "Subtitle",
"text": "Strategy Manage Stage",
"updated": 1611257655850
},
{
"style": "Include",
"text": "Superalgos->Node->Strategy Manage Stage->Definition",
"updated": 1611257660113
},
{
"style": "Include",
"text": "Superalgos->Node->Strategy Manage Stage->Content",
"updated": 1611257664015
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Strategy Manage Stage->2",
"updated": 1611257866068
},
{
"style": "Subtitle",
"text": "Strategy Close Stage",
"updated": 1611257705432
},
{
"style": "Include",
"text": "Superalgos->Node->Strategy Close Stage->Definition",
"updated": 1611257709416
},
{
"style": "Include",
"text": "Superalgos->Node->Strategy Close Stage->Content",
"updated": 1611257713254
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Strategy Close Stage->3",
"updated": 1611257720858
}
]
}
@@ -0,0 +1,169 @@
{
"topic": "Trading Engine",
"pageNumber": "6",
"type": "Base Asset and Quoted Asset",
"definition": {
"text": "Keep track of accounts denominated in the base asset and the quoted asset, in multiple contexts. On this page: Episode Base Asset, Episode Quoted Asset, Position Base Asset, Position Quoted Asset, Stage Base Asset, Stage Quoted Asset, Order Base Asset, Order Quoted Asset.",
"updated": 1611258310236
},
"paragraphs": [
{
"style": "Text",
"text": "Because the system aims to be as flexible as possible, the trading engine keeps the accounts relative to both the base asset and the quoted asset. This allows the user to set up the trading system with whatever logic is required and decide which set of accounts suits the intent—the goal—of the trading strategy.",
"updated": 1611258333516
},
{
"style": "Callout",
"text": "Notice that—usually—the accounts denominated in one asset will be valid, while the accounts denominated in the other asset will likely make no sense."
},
{
"style": "Text",
"text": "Which set of accounts you will monitor to track the performance of the episode depends on how you define your trading system."
},
{
"style": "Text",
"text": "For example, If you are trading the BTC/USDT market and developed a trading system to accumulate USDT, then the set of accounts that will make sense for you is the one denominated in the quoted asset, that is, in USDT. This is why:"
},
{
"style": "Text",
"text": "Your strategy will likely buy BTC (the base asset) expecting the price to go up while the position is open, in order to sell BTC at a higher rate and end up with more USDT (the quoted asset) than you started with."
},
{
"style": "Title",
"text": "Example",
"updated": 1611258412121
},
{
"style": "Text",
"text": "Let’s say you buy 10,000 USDT worth of BTC. BTC price increases by 10%, so you sell the whole amount of BTC to close the position and end up with 10,900 USDT (exchange fees are deducted from the balance)."
},
{
"style": "Text",
"text": "In terms of the base asset, your begin balance is 0 BTC and your end balance is 0.00000012 BTC, as the exchange left some BTC dust in the account due to rate conversion limitations. Also in terms of the base asset, your profit loss for the position is...",
"updated": 1611258453118
},
{
"style": "Text",
"text": ""
},
{
"style": "Json",
"text": "0.00000012 BTC - 0 BTC = 0.00000012 BTC",
"updated": 1611258465358
},
{
"style": "Text",
"text": "ROI and other metrics may be derived from these initial observations as well. Needless to say, such metrics are irrelevant to the intent of the strategy, which is to accumulate USDT."
},
{
"style": "Text",
"text": "Now, in terms of the base asset, your begin balance is 10,000 USDT and your end balance is 10,900 USDT (exchange fees are deducted from the balance). Also in terms of the quoted asset, your profit loss for the position is...",
"updated": 1611258484205
},
{
"style": "Json",
"text": "10,900 USDT - 10,000 USDT = 900 USDT"
},
{
"style": "Text",
"text": "It should be clear by now that these are the metrics relevant to the intent of the strategy."
},
{
"style": "Note",
"text": "With other types of strategies, for example, those in which the intent is to accumulate both assets, both sets of metrics may be relevant. Also, the consolidated metrics provided in the context of statistics may be relevant too.",
"updated": 1611258499505
},
{
"style": "Text",
"text": "The concepts relative to base and quoted asset, such as the balance of each asset and the performance metrics computed from the perspective of each asset, are tracked in multiple contexts simultaneously."
},
{
"style": "Text",
"text": "What follows are the definitions of the base and quoted asset in each of the contexts that the concepts are tracked."
},
{
"style": "Title",
"text": "Episode Base Asset",
"updated": 1611258577948
},
{
"style": "Include",
"text": "Superalgos->Node->Episode Base Asset->Definition",
"updated": 1611258580907
},
{
"style": "Title",
"text": "Episode Quoted Asset",
"updated": 1611258588997
},
{
"style": "Include",
"text": "Superalgos->Node->Episode Quoted Asset->Definition",
"updated": 1611258592849
},
{
"style": "Title",
"text": "Position Base Asset",
"updated": 1611258602952
},
{
"style": "Include",
"text": "Superalgos->Node->Position Base Asset->Definition",
"updated": 1611258605932
},
{
"style": "Title",
"text": "Position Quoted Asset",
"updated": 1611258616805
},
{
"style": "Include",
"text": "Superalgos->Node->Position Quoted Asset->Definition",
"updated": 1611258619810
},
{
"style": "Title",
"text": "Stage Base Asset",
"updated": 1611258630368
},
{
"style": "Include",
"text": "Superalgos->Node->Stage Base Asset->Definition",
"updated": 1611258633312
},
{
"style": "Title",
"text": "Stage Quoted Asset",
"updated": 1611258644044
},
{
"style": "Include",
"text": "Superalgos->Node->Stage Quoted Asset->Definition",
"updated": 1611258647352
},
{
"style": "Title",
"text": "Order Base Asset",
"updated": 1611258657391
},
{
"style": "Include",
"text": "Superalgos->Node->Order Base Asset->Definition",
"updated": 1611258660759
},
{
"style": "Title",
"text": "Order Quoted Asset",
"updated": 1611258669352
},
{
"style": "Include",
"text": "Superalgos->Node->Order Quoted Asset->Definition",
"updated": 1611258672239
},
{
"style": "Text",
"text": ""
}
]
}
@@ -0,0 +1,171 @@
{
"topic": "Trading Engine",
"pageNumber": "7",
"type": "Counters",
"definition": {
"text": "Keep track of how many instances of certain objects have existed in a given context. On this page: Periods, Strategies, Positions, Orders, and Days.",
"updated": 1611259332958
},
"paragraphs": [
{
"style": "Text",
"text": "A counter keeps track of how many instances of certain objects have come to exist—or have taken a certain value—during the duration of a certain context.",
"updated": 1611259349617
},
{
"style": "Text",
"text": "For example, how many positions have been open during an episode, or how many of those positions have been hits."
},
{
"style": "Text",
"text": "Counters are kept in multiple contexts simultaneously. In particular, you will find episode counters, strategy counters, position counters, and order counters."
},
{
"style": "Text",
"text": ""
},
{
"style": "Title",
"text": "Counter-specific Nodes"
},
{
"style": "Subtitle",
"text": "Periods",
"updated": 1611259406618
},
{
"style": "Include",
"text": "Superalgos->Node->Periods->Definition",
"updated": 1611259409668
},
{
"style": "Subtitle",
"text": "Strategies",
"updated": 1611259416144
},
{
"style": "Include",
"text": "Superalgos->Node->Strategies->Definition",
"updated": 1611259419177
},
{
"style": "Subtitle",
"text": "Positions",
"updated": 1611259428759
},
{
"style": "Include",
"text": "Superalgos->Node->Positions->Definition",
"updated": 1611259431976
},
{
"style": "Subtitle",
"text": "Orders",
"updated": 1611259442020
},
{
"style": "Include",
"text": "Superalgos->Node->Orders->Definition",
"updated": 1611259444724
},
{
"style": "Subtitle",
"text": "Days",
"updated": 1611259453496
},
{
"style": "Include",
"text": "Superalgos->Node->Days->Definition",
"updated": 1611259459728
},
{
"style": "Include",
"text": "Superalgos->Node->Days->Content",
"updated": 1611259823914
},
{
"style": "Text",
"text": ""
},
{
"style": "Note",
"text": "Other properties typical to counters are defined elsewhere, as they are not specific to counters. Find below the different contexts in which counters are found.",
"updated": 1611259860203
},
{
"style": "Title",
"text": "Episode Counters",
"updated": 1611260075956
},
{
"style": "Include",
"text": "Superalgos->Node->Episode Counters->Definition",
"updated": 1611260079244
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Episode Counters->2",
"updated": 1611260082549
},
{
"style": "Title",
"text": "Strategy Counters"
},
{
"style": "Include",
"text": "Superalgos->Node->Strategy Counters->Definition",
"updated": 1611259923717
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Strategy Counters->2",
"updated": 1611259927606
},
{
"style": "Title",
"text": "Position Counters",
"updated": 1611259936812
},
{
"style": "Include",
"text": "Superalgos->Node->Position Counters->Definition",
"updated": 1611259939595
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Position Counters->2",
"updated": 1611259944892
},
{
"style": "Title",
"text": "Order Counters",
"updated": 1611259959379
},
{
"style": "Include",
"text": "Superalgos->Node->Order Counters->Definition",
"updated": 1611259963832
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Order Counters->2",
"updated": 1611259967561
}
]
}
@@ -0,0 +1,77 @@
{
"topic": "Trading Engine",
"pageNumber": "8",
"type": "Statistics",
"definition": {
"text": "Track popular statistics consolidating both the base asset and the quoted asset. On this page: Episode Statistics, Position Statistics, and Order Statistics.",
"updated": 1611260196449
},
"paragraphs": [
{
"style": "Text",
"text": "Statistics are accounts and performance metrics calculated by consolidating the base asset and the quoted asset, that is, taking both assets into account.",
"updated": 1611260210428
},
{
"style": "Text",
"text": "The mechanics of how both assets are consolidated and how the consolidation affects the calculations are explained in the definitions of each of the concepts."
},
{
"style": "Title",
"text": "Episode Statistics",
"updated": 1611260256691
},
{
"style": "Include",
"text": "Superalgos->Node->Episode Statistics->Definition",
"updated": 1611260259469
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Episode Statistics->2",
"updated": 1611260262273
},
{
"style": "Title",
"text": "Position Statistics",
"updated": 1611260273697
},
{
"style": "Include",
"text": "Superalgos->Node->Position Statistics->Definition",
"updated": 1611260277415
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Position Statistics->2",
"updated": 1611260280519
},
{
"style": "Title",
"text": "Order Statistics",
"updated": 1611260292859
},
{
"style": "Include",
"text": "Superalgos->Node->Order Statistics->Definition",
"updated": 1611260295959
},
{
"style": "Include",
"text": "Superalgos->Concept->Reusable Snippets->Note for Hierarchy Tables No Discussion"
},
{
"style": "Hierarchy",
"text": "Superalgos->Order Statistics->2",
"updated": 1611260299229
}
]
}
@@ -13,6 +13,72 @@
{
"style": "Error",
"text": "Unexpected Error"
},
{
"style": "Title",
"text": "Error Details",
"updated": 1611258020914
},
{
"style": "Text",
"text": "In the following section you will find the specific information received when this error occured."
},
{
"style": "Success",
"text": "You will only see it if you opened this page as a result of the error actually happening.",
"updated": 1611258030660
},
{
"style": "Subtitle",
"text": "Error Message"
},
{
"style": "Text",
"text": "The following is the Error Message of the Exception that occured at the TS:"
},
{
"style": "Placeholder",
"text": "errorMessage"
},
{
"style": "Subtitle",
"text": "Error Stack"
},
{
"style": "Text",
"text": "The following is the Error Stack of the Exception that occured at the TS:"
},
{
"style": "Placeholder",
"text": "errorStack"
},
{
"style": "Subtitle",
"text": "Error Code"
},
{
"style": "Text",
"text": "The follwing is the Error Code of the Exception that occured at the TS:"
},
{
"style": "Placeholder",
"text": "errorCode"
},
{
"style": "Subtitle",
"text": "Error Details"
},
{
"style": "Text",
"text": "The follwing are all the Error details of the Exception that occured at the TS:"
},
{
"style": "Placeholder",
"text": "errorDetails"
},
{
"style": "Text",
"text": ""
}
]
}
@@ -16,8 +16,20 @@
},
{
"style": "Title",
"text": "Error Message",
"updated": 1610971316249
"text": "Error Details",
"updated": 1611151211050
},
{
"style": "Text",
"text": "In the following section you will find the specific information received when this error occured."
},
{
"style": "Note",
"text": "You will only see it if you opened this page as a result of the error actually happening."
},
{
"style": "Subtitle",
"text": "Error Message"
},
{
"style": "Text",
@@ -30,7 +42,7 @@
"updated": 1610971337737
},
{
"style": "Title",
"style": "Subtitle",
"text": "Error Stack",
"updated": 1610968600444
},
@@ -45,7 +57,7 @@
"updated": 1610968640796
},
{
"style": "Title",
"style": "Subtitle",
"text": "Error Code"
},
{
@@ -56,6 +68,23 @@
"style": "Placeholder",
"text": "errorCode"
},
{
"style": "Subtitle",
"text": "Error Details"
},
{
"style": "Text",
"text": "The follwing are all the Error details of the Exception that occured at the TS:",
"updated": 1611257840235
},
{
"style": "Placeholder",
"text": "errorDetails"
},
{
"style": "Text",
"text": ""
},
{
"style": "Text",
"text": ""
@@ -12,12 +12,13 @@
"paragraphs": [
{
"style": "Text",
"text": "Sometimes you may wish to visualize larger sections of hierarchies than your screen allows."
"text": "Sometimes you may wish to visualize larger sections of the Design Space than your screen allows.",
"updated": 1611314074367
},
{
"style": "Callout",
"text": "Hit Ctrl and scroll the mouse wheel!",
"updated": 1611076507997
"text": "Hit Ctrl and scroll the mouse wheel on Windows or <kbd>⌘</kbd> and <kbd>-</kbd> or <kbd>+</kbd> in Mac.",
"updated": 1611314352825
},
{
"style": "Text",
@@ -25,7 +26,8 @@
},
{
"style": "Success",
"text": "Chrome indicates the level of zoom on the top-right corner. When zooming in or out, the design space gets centered on the screen. After applying the desired level of zoom, use the design space map to go back where you were."
"text": "Chrome indicates the level of zoom on the top-right corner. When zooming in or out, the design space gets centered on the screen. Use the design space map to go back where you were.",
"updated": 1611314381796
}
]
}
@@ -19,7 +19,6 @@
return thisObject;
function initialize(pStatusDependencies, pDataDependencies, callBackFunction) {
statusDependencies = pStatusDependencies;
dataDependenciesModule = pDataDependencies;
@@ -96,6 +96,7 @@
function initializeProcessExecutionEvents() {
try {
processExecutionEvents = TS.projects.superalgos.processModules.processExecutionEvents.newSuperalgosProcessModulesProcessExecutionEvents(processIndex)
processExecutionEvents.initialize(onInizialized);
@@ -118,8 +119,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -127,24 +128,24 @@
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -178,8 +179,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -187,24 +188,24 @@
"[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessExecutionEvents -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -233,8 +234,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -242,24 +243,24 @@
"[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeStatusDependencies -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -296,8 +297,8 @@
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeDataDependencies -> onInizialized -> Process Framework Name = " +
TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.framework.name);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -311,11 +312,11 @@
return;
}
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
processStopped()
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeDataDependencies -> onInizialized -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -323,24 +324,24 @@
"[ERROR] run -> loop -> initializeDataDependencies -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeDataDependencies -> onInizialized -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeDataDependencies -> onInizialized -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeDataDependencies -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -368,8 +369,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeBotModuleObject -> onInizialized -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
case TS.projects.superalgos.globals.standardResponses.CUSTOM_OK_RESPONSE.result: {
@@ -378,8 +379,8 @@
default: {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeBotModuleObject -> onInizialized > Unhandled custom response received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -389,24 +390,24 @@
"[ERROR] run -> loop -> initializeBotModuleObject -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeBotModuleObject -> onInizialized -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeBotModuleObject -> onInizialized -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeBotModuleObject -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -434,8 +435,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startBotModuleObject -> onFinished -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
case TS.projects.superalgos.globals.standardResponses.CUSTOM_OK_RESPONSE.result: {
@@ -458,8 +459,8 @@
default: {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startBotModuleObject -> onFinished -> Unhandled custom response received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -469,24 +470,24 @@
"[ERROR] run -> loop -> startBotModuleObject -> onFinished -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startBotModuleObject -> onFinished -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startBotModuleObject -> onFinished -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startBotModuleObject -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -514,8 +515,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> intitializeProcessFramework -> onInizialized -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
case TS.projects.superalgos.globals.standardResponses.CUSTOM_OK_RESPONSE.result: {
@@ -524,8 +525,8 @@
default: {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> intitializeProcessFramework -> onInizialized > Unhandled custom response received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -535,24 +536,24 @@
"[ERROR] run -> loop -> intitializeProcessFramework -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> intitializeProcessFramework -> onInizialized -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> intitializeProcessFramework -> onInizialized -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> intitializeProcessFramework -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -587,8 +588,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessFramework -> onFinished -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
case TS.projects.superalgos.globals.standardResponses.CUSTOM_OK_RESPONSE.result: {
@@ -611,8 +612,8 @@
default: {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessFramework -> onFinished -> Unhandled custom response received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -622,24 +623,24 @@
"[ERROR] run -> loop -> startProcessFramework -> onFinished -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessFramework -> onFinished -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessFramework -> onFinished -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessFramework -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -671,8 +672,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -680,24 +681,24 @@
"[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> finishProcessExecutionEvents -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -715,7 +716,7 @@
function onStop() {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[INFO] run -> loop -> loopControl -> onStop -> Stopping the Loop Gracefully. See you next time!")
processStopped()
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return;
}
@@ -777,46 +778,20 @@
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> shallWeStop -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
function processStopped() {
if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) {
TS.projects.superalgos.functionLibraries.processFunctions.processError
(
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY,
undefined,
"An unexpected error caused the Process to stop.",
{
project: 'Superalgos',
category: 'Topic',
type: 'TS Process Error - Unexpected Error'
}
)
} else {
TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, 'Stopped')
}
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.persist();
clearTimeout(nextLoopTimeoutHandle);
if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) {
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
} else {
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE)
}
}
} catch (err) {
TS.projects.superalgos.globals.taskVariables.UNEXPECTED_ERROR = err
@@ -20,7 +20,6 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
let fetchType = "by Time"
let lastId
let firstId
let allOHLCVs = []
let thisReport;
let since
let initialProcessTimestamp
@@ -119,6 +118,11 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
function start(callBackFunction) {
try {
/*
Initialize the array where we are going to receive the
data from the exchange.
*/
let rawDataArray = []
if (TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true) {
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
@@ -252,7 +256,7 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
processingDate = processingDate.getUTCFullYear() + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(processingDate.getUTCMonth() + 1, 2) + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(processingDate.getUTCDate(), 2);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[INFO] start -> getOHLCVs -> Fetching OHLCVs @ " + processingDate + "-> exchange = " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " -> symbol = " + symbol + " -> since = " + since + " -> limit = " + limit)
let heartBeatText = "Fetching " + allOHLCVs.length.toFixed(0) + " OHLCVs from " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate
let heartBeatText = "Fetching " + rawDataArray.length.toFixed(0) + " OHLCVs from " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate
let currentDate = new Date(since)
let percentage = TS.projects.superalgos.utilities.dateTimeFunctions.getPercentage(fromDate, currentDate, lastDate)
TS.projects.superalgos.functionLibraries.processFunctions.processHeartBeat(processIndex, heartBeatText, percentage) // tell the world we are alive and doing well
@@ -332,7 +336,7 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
let OHLCVKey = OHLCV[0] + '-' + OHLCV[1].toFixed(16) + '-' + OHLCV[2].toFixed(16) + '-' + OHLCV[3].toFixed(16) + '-' + OHLCV[4].toFixed(16) + '-' + OHLCV[5].toFixed(16)
if (OHLCVKey !== lastOHLCVKey) {
allOHLCVs.push(OHLCV)
rawDataArray.push(OHLCV)
}
lastOHLCVKey = OHLCVKey
}
@@ -343,7 +347,7 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
if (
OHLCVs.length < limit - 1 ||
TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true ||
allOHLCVs.length >= MAX_OHLCVs_PER_EXECUTION
rawDataArray.length >= MAX_OHLCVs_PER_EXECUTION
) {
break
}
@@ -376,18 +380,27 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
}
async function saveOHLCVs() {
/*
What we are going to do in this function is to save all the candles
received from the exchage. We need to partition the batch of candles
into 1 day files. At the same time we need to take care of the situation
that some exchanges send inconsitent data. We have detected some cases
where candles do not begin at second 0 of the minute but are a little
bit shifted. We will try to detectthis and fix it as we go.
We have the data received from the exchage at the arrary rawDataArray
*/
try {
let candlesFileContent = '['
let volumesFileContent = '['
let previousDay = Math.trunc((initialProcessTimestamp - TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS) / TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS)
let currentDay = Math.trunc((initialProcessTimestamp - TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS) / TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS)
let needSeparator = false
let error
let separator
let heartBeatCounter = 0
let headOfTheMarketReached = false
let savingProcedureFinished = false
let endOfTheOHLCVArrayReached = false
let currentDay = Math.trunc((initialProcessTimestamp - TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS) / TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS)
let lastCandle = {
begin: 0,
@@ -405,55 +418,104 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
sell: 0
}
let i = 0
let ohlcvArrayIndex = 0
lastId = undefined
if (lastCandleOfTheDay !== undefined) {
lastCandle = JSON.parse(JSON.stringify(lastCandleOfTheDay))
}
/*
At a macro level, we will be creating one file per day, so we will
run into a loop that each run will represent one day.
*/
controlLoop()
function loop() {
/*
Here we will try to match the OHLCVs received with each possible
candle of a single day.
*/
let filesToCreate = 0
let filesCreated = 0
/* Go through all possible 1 min candles of a day. */
for (let j = 0; j < 60 * 24; j++) {
/*
We will loop aroud all the possible 1 minute candles that be found
on a single day. For each minute of the day, we will try to find
the matching OHLCV. This would be an easy task if the exchanges
would allways return consistent data, but that is not the case.
Sometimes, some candles are missing. We have seen also candles that
do not start at an UTC minute, they are shifted in time some seconds.
In order to address all these inconsistencies the process gets a little
bit complicated.
*/
for (let minuteOfTheDay = 0; minuteOfTheDay < 60 * 24; minuteOfTheDay++) {
/*
We initialize our candle and volume objecs positioning them
at the current minute of the day of the current day. We also
initialize them with the last candle and volume property values.
The reason we do this last thing is because we don't knwo if
we are going to find or not a matching OHLCV. If we do find one
these property values will be overwritten, and if not, they will
hold at least the last know value.
*/
let candle = {
begin: currentDay * TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS * j,
end: currentDay * TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS * j + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS - 1,
begin: currentDay * TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS * minuteOfTheDay,
end: currentDay * TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS * minuteOfTheDay + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS - 1,
open: lastCandle.close,
close: lastCandle.close,
min: lastCandle.close,
max: lastCandle.close
}
let volume = {
begin: currentDay * TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS * j,
end: currentDay * TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS * j + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS - 1,
begin: currentDay * TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS * minuteOfTheDay,
end: currentDay * TS.projects.superalgos.globals.timeConstants.ONE_DAY_IN_MILISECONDS + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS * minuteOfTheDay + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS - 1,
buy: lastVolume.buy,
sell: lastVolume.sell
}
let processingDate = new Date(candle.begin)
processingDate = processingDate.getUTCFullYear() + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(processingDate.getUTCMonth() + 1, 2) + '-' + TS.projects.superalgos.utilities.miscellaneousFunctions.pad(processingDate.getUTCDate(), 2);
/*
Here we will check that the current candle is not going into the future.
Remember we are looping around all possible minutes of a day, and when
that day is the current actual day, and the current minute is in the future,
it manke no more sense to continue inside this loop since we are not going
to find more OHLCVs matchings.
if (candle.begin > (new Date()).valueOf()) {
At the same time, we are going to check that we haven't processed the whole
OHLCV array. Once we reached the end of it, it makes no sense to continue
inside this loop.
*/
if (
candle.begin > (new Date()).valueOf() ||
endOfTheOHLCVArrayReached === true
) {
/* We stop when the current candle is pointing to a time in the future.*/
headOfTheMarketReached = true
savingProcedureFinished = true
/*
This will be our last file saved.
*/
saveFile(currentDay)
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[INFO] start -> saveOHLCVs -> Before Fetch -> Saving OHLCVs @ " + processingDate + " -> i = " + i + " -> total = " + allOHLCVs.length)
TS.projects.superalgos.functionLibraries.processFunctions.processHeartBeat(processIndex, "Saving " + i.toFixed(0) + " / " + allOHLCVs.length + " OHLCVs from " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well
/*
We will produce our last log and heartbeat, since we have just
reached the head of the market.
*/
logAndHeartBeat()
/* We exit the loop and we aint comming back*/
return
}
let OHLCV = { // these values should be overrided unless there are no OHLVCs fetched from the exchange.
/*
We initialize here the OHLCV object. These initial
values should be overrided unless there are no
OHLVCs fetched from the exchange. We need the
timestamp in order to calculate OHLCVMinute.
*/
let OHLCV = {
timestamp: (new Date()).valueOf() + TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS,
open: 0,
hight: 0,
@@ -462,9 +524,16 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
volume: 0
}
let record = allOHLCVs[i]
let record = rawDataArray[ohlcvArrayIndex]
if (record !== undefined) { // can be undefined if there is no candle fetched from the exchange
/*
We will check that we can have a record to
analize. It might happen that we don't have one
in the situation that we could not get a single
record from the exchange. We still want to be
here so that everything is properly logged.
*/
if (record !== undefined) {
OHLCV = {
timestamp: record[0],
open: record[1],
@@ -477,48 +546,73 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
let candleMinute = Math.trunc(candle.begin / TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS)
let OHLCVMinute
/*
Some exchanges return inconsistent data. It is not guaranteed
that each candle will have a timeStamp exactly at the begining of an
UTC minute. It is also not guaranteed that the distance
between timestamps will be the same. To fix this, we will do this.
*/
checkOHLCVMinute()
OHLCVMinute = Math.trunc(OHLCV.timestamp / TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS)
function checkOHLCVMinute() {
/*
Some exchanges return inconsistent data. It is not guaranteed that each candle will have a timeStamp exactly at the begining of an
UTC minute. It is also not guaranteed that the distance between timestamps will be the same. To fix this, we will do this.
*/
/*
If the minute of the record item received from the exchange is
less than the minute of the current minute in our loop,
that means that we need to reposition the inded at the rawDataArray
array, moving it one record fordward, and that is what we are
doing here.
*/
while (OHLCVMinute < candleMinute) {
OHLCVMinute = Math.trunc(OHLCV.timestamp / TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS)
/* Move fordward at the rawDataArray array. */
ohlcvArrayIndex++
if (OHLCVMinute < candleMinute) {
if (i >= allOHLCVs.length - 1) {
/* We run out of OHLCVs, we can not move to the next OHLCV, we leave this function. */
return
}
i++
record = allOHLCVs[i]
OHLCV = {
timestamp: record[0],
open: record[1],
hight: record[2],
low: record[3],
close: record[4],
volume: record[5],
id: record[6]
}
setImmediate (checkOHLCVMinute)
/* Check that we have not passed the end of the array */
if (ohlcvArrayIndex > rawDataArray.length - 1) {
/*
We run out of OHLCVs, we can not move to the next OHLCV,
we need to leave this loop.
*/
break
}
record = rawDataArray[ohlcvArrayIndex]
/*
Once this loop is broken, this is the OHLCV that needs
to be considered. All the ones in the past are ignored.
*/
OHLCV = {
timestamp: record[0],
open: record[1],
hight: record[2],
low: record[3],
close: record[4],
volume: record[5],
id: record[6]
}
/* Recalculate this to see if we need to break the loop*/
OHLCVMinute = Math.trunc(OHLCV.timestamp / TS.projects.superalgos.globals.timeConstants.ONE_MIN_IN_MILISECONDS)
}
/* Reporting we are doing well */
heartBeatCounter--
if (heartBeatCounter <= 0) {
heartBeatCounter = 1440
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[INFO] start -> saveOHLCVs -> After Fetch -> Saving OHLCVs @ " + processingDate + " -> i = " + i + " -> total = " + allOHLCVs.length)
TS.projects.superalgos.functionLibraries.processFunctions.processHeartBeat(processIndex, "Saving " + i.toFixed(0) + " / " + allOHLCVs.length + " OHLCVs from " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well
}
/* End Reporting */
/*
If the candleMinute and the OHLCVMinute matches, then
we transfer the properties of the OHLCV into the
candle object and the volume object. Two things to
consider here:
1. If they do not match, at this point it could only means
that the OHLCVMinute is in the future, in which case the
candle and volume will keep their initialization values
which in turn are equal to the latest candle and volumes.
2. They might be equal even though the OHLCV timestamp
did not match exactly the UTC minute, but since we are
comparing truncated values, then we force the matching
and we correct the shifting in time that sometimes happens
with exchange data.
*/
if (candleMinute === OHLCVMinute) {
candle.open = OHLCV.open
candle.close = OHLCV.close
@@ -527,14 +621,25 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
volume.buy = OHLCV.volume / 2
volume.sell = OHLCV.volume / 2
if (i < allOHLCVs.length - 1) {
i++
/*
Since we extracted this OHLCV value, we move
fordward our array index.
*/
if (ohlcvArrayIndex < rawDataArray.length - 1) {
ohlcvArrayIndex++
} else {
endOfTheOHLCVArrayReached = true
}
lastId = OHLCV.id
}
/*
Here we remeber the last candle and volumen, in case
we need it.
*/
lastCandle = candle
lastVolume = volume
if (needSeparator === false) {
needSeparator = true;
@@ -548,14 +653,40 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
volumesFileContent = volumesFileContent + separator + '[' + volume.buy + "," + volume.sell + "," + volume.begin + "," + volume.end + "]";
/* We store the last candle of the day in order to have a previous candles during next execution. */
if (j === 1440 - 1) {
if (minuteOfTheDay === 1440 - 1) {
lastCandleOfTheDay = JSON.parse(JSON.stringify(candle))
}
/* Reporting we are doing well */
heartBeatCounter--
if (heartBeatCounter <= 0) {
heartBeatCounter = 1440
logAndHeartBeat()
}
function logAndHeartBeat() {
/* We need thi processing date for logging purposes only */
let processingDate = new Date(candle.begin)
processingDate =
processingDate.getUTCFullYear() + '-' +
TS.projects.superalgos.utilities.miscellaneousFunctions.pad(processingDate.getUTCMonth() + 1, 2) + '-' +
TS.projects.superalgos.utilities.miscellaneousFunctions.pad(processingDate.getUTCDate(), 2);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[INFO] start -> saveOHLCVs -> Before Fetch -> Saving OHLCVs @ " + processingDate + " -> ohlcvArrayIndex = " + ohlcvArrayIndex + " -> total = " + rawDataArray.length)
TS.projects.superalgos.functionLibraries.processFunctions.processHeartBeat(processIndex, "Saving " + (ohlcvArrayIndex + 1).toFixed(0) + " / " + rawDataArray.length + " OHLCVs from " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name + " " + symbol + " @ " + processingDate) // tell the world we are alive and doing well
}
}
previousDay = currentDay
if (i > 0) { // Only start saving at the day of the first candle.
/*
When the bot is processing historical information, it
happens that during the whole processing of one day
it did not reach either the head of the market (a future time)
nor the end of the Raw Data Array. In this situation
we still need to save the full day of content, and
we do it only if at least one candle has been processed.
*/
if (ohlcvArrayIndex > 0) {
saveFile(currentDay)
return
}
@@ -565,7 +696,7 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
function saveFile(day) {
candlesFileContent = candlesFileContent + ']'
volumesFileContent = volumesFileContent + ']'
let fileName = 'Data.json'
filesToCreate++
@@ -577,7 +708,6 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
candlesFileContent = '['
volumesFileContent = '['
needSeparator = false
}
function onFileCreated(err) {
@@ -605,39 +735,60 @@ exports.newSuperalgosBotModulesHistoricOHLCVs = function (processIndex) {
}
function controlLoop() {
/*
This loop advances one day, and if it does not need to stop
for any reason, it will execute the loop function so as to process
the next day.
*/
currentDay++
/*
It might have happened that the User is stopping the Task. If that
is the case, we need to stop this processing here.
*/
if (TS.projects.superalgos.globals.taskVariables.IS_TASK_STOPPING === true) {
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE);
return
}
/*
If we had any problem saving the latest file, we will also abort
this process here, so that we can record our progress until it stopped
working.
*/
if (error) {
callBackFunction(error);
return;
}
currentDay++
/*
One possible exit is when we reached the amount of candles downloaded. This not necesary happens at the end of the market
if the process was canceled for any reason at the middle.
One possible exit is when we reached the amount of candles downloaded.
This does not necesary happens at the end of the market
if the process was canceled for any reason at the middle,
or the exchange became unavailable.
*/
if (i >= allOHLCVs.length - 1) {
if (ohlcvArrayIndex >= rawDataArray.length - 1) {
writeStatusReport()
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[INFO] start -> saveOHLCVs -> controlLoop -> Exit because i reached the end of the candles array. ")
"[INFO] start -> saveOHLCVs -> controlLoop -> Exit because i reached the end of the rawDataArray array. ")
return
}
/* The natural exit is at the end of the market */
if (headOfTheMarketReached === false) {
setImmediate(loop)
} else {
/*
The most common exit is at the end of the market. There is
nothing else to save, so we finish here.
*/
if (savingProcedureFinished === true) {
writeStatusReport()
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[INFO] start -> saveOHLCVs -> controlLoop -> Exit because we reached the end of the market. ")
writeStatusReport()
return
}
/*
If there is no reson to exit, we will process the next day.
*/
setImmediate(loop)
}
} catch (err) {
@@ -118,8 +118,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -127,16 +127,16 @@
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -144,8 +144,8 @@
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -179,8 +179,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -188,24 +188,24 @@
"[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessExecutionEvents -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -234,8 +234,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -243,24 +243,24 @@
"[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeStatusDependencies -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -288,8 +288,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeBotModuleObject -> onInizialized > Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
case TS.projects.superalgos.globals.standardResponses.CUSTOM_OK_RESPONSE.result: {
@@ -298,8 +298,8 @@
default: {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeBotModuleObject -> onInizialized > Unhandled custom response received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -309,24 +309,24 @@
"[ERROR] run -> loop -> initializeBotModuleObject -> onInizialized > Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeBotModuleObject -> onInizialized > Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeBotModuleObject -> onInizialized -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeBotModuleObject -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -354,8 +354,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startBotModuleObject -> onFinished > Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
case TS.projects.superalgos.globals.standardResponses.CUSTOM_OK_RESPONSE.result: {
@@ -378,8 +378,8 @@
default: {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startBotModuleObject -> onFinished > Unhandled custom response received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -389,24 +389,24 @@
"[ERROR] run -> loop -> startBotModuleObject -> onFinished > Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startBotModuleObject -> onFinished > Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startBotModuleObject -> onFinished -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startBotModuleObject -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -438,8 +438,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -447,24 +447,24 @@
"[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> finishProcessExecutionEvents -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -480,7 +480,7 @@
function onStop() {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[INFO] run -> loop -> loopControl -> onStop -> Stopping the Loop Gracefully. See you next time!")
processStopped()
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return;
}
@@ -534,8 +534,8 @@
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> shallWeStop -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -543,36 +543,11 @@
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
function processStopped() {
if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) {
TS.projects.superalgos.functionLibraries.processFunctions.processError
(
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY,
undefined,
"An unexpected error caused the Process to stop.",
{
project: 'Superalgos',
category: 'Topic',
type: 'TS Process Error - Unexpected Error'
}
)
} else {
TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, 'Stopped')
}
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.persist();
clearTimeout(nextLoopTimeoutHandle);
if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) {
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
} else {
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE)
}
}
}
catch (err) {
@@ -128,8 +128,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -137,24 +137,24 @@
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> onInizialized -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeProcessExecutionEvents -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -188,8 +188,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -197,24 +197,24 @@
"[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessExecutionEvents -> onStarted -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessExecutionEvents -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -243,8 +243,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -252,24 +252,24 @@
"[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeStatusDependencies -> onInizialized -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeStatusDependencies -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -296,8 +296,8 @@
"[ERROR] run -> loop -> initializeDataDependencies -> onInizialized -> Process Framework not Supported.");
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeDataDependencies -> onInizialized -> Process Framework Name = " + TS.projects.superalgos.globals.taskConstants.TASK_NODE.bot.processes[processIndex].referenceParent.config.framework.name);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -313,8 +313,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeDataDependencies -> onInizialized -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -322,24 +322,24 @@
"[ERROR] run -> loop -> initializeDataDependencies -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeDataDependencies -> onInizialized -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeDataDependencies -> onInizialized -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> initializeDataDependencies -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -367,15 +367,15 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> intitializeProcessFramework -> onInizialized -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
case TS.projects.superalgos.globals.standardResponses.CUSTOM_OK_RESPONSE.result: {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> intitializeProcessFramework -> onInizialized > Unhandled custom response received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -383,24 +383,24 @@
"[ERROR] run -> loop -> intitializeProcessFramework -> onInizialized -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> intitializeProcessFramework -> onInizialized -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> intitializeProcessFramework -> onInizialized -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> intitializeProcessFramework -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -436,8 +436,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessFramework -> onFinished -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
case TS.projects.superalgos.globals.standardResponses.CUSTOM_OK_RESPONSE.result: {
@@ -460,8 +460,8 @@
default: {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessFramework -> onFinished -> Unhandled custom response received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -471,24 +471,24 @@
"[ERROR] run -> loop -> startProcessFramework -> onFinished -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessFramework -> onFinished -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessFramework -> onFinished -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> startProcessFramework -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -520,8 +520,8 @@
case TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE.result: { // This is an unexpected exception that we do not know how to handle.
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> Operation Failed. Aborting the process.");
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
default: {
@@ -529,24 +529,24 @@
"[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> Unhandled err.result received. -> err.result = " + err.result);
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> Unhandled err.result received. -> err = " + err.message);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> finishProcessExecutionEvents -> onFinished -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> finishProcessExecutionEvents -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -567,7 +567,7 @@
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.persist();
TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_KEY, 'Stopped')
processStopped()
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return;
}
@@ -664,8 +664,8 @@
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> shallWeStop -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
@@ -673,45 +673,12 @@
} catch (err) {
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_INSTANCE_LOGGER_MODULE_OBJECT.write(MODULE_NAME,
"[ERROR] run -> loop -> err = " + err.stack);
TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE = err.message
processStopped()
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR = err
TS.projects.superalgos.functionLibraries.processFunctions.stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle)
return
}
}
function processStopped() {
if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) {
TS.projects.superalgos.functionLibraries.processFunctions.processError
(
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY,
undefined,
"An unexpected error caused the Process to stop.",
{
project: 'Superalgos',
category: 'Topic',
type: 'TS Process Error - Unexpected Error'
}
)
} else {
TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, 'Stopped')
}
sessionStopped()
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.persist();
clearTimeout(nextLoopTimeoutHandle);
if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE !== undefined) {
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
} else {
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE)
}
}
function sessionStopped() {
if (TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_STATUS === 'Running') {
TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_KEY, 'Stopped')
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_STATUS = 'Stopped'
}
}
} catch (err) {
TS.projects.superalgos.globals.taskVariables.UNEXPECTED_ERROR = err
@@ -43,6 +43,10 @@ exports.newSuperalgosFunctionLibrariesNodeJSFunctions = function () {
text: TS.projects.superalgos.globals.taskVariables.UNEXPECTED_ERROR.code
}
}
docs.placeholder.errorDetails = {
style: 'Json',
text: JSON.stringify(TS.projects.superalgos.globals.taskVariables.UNEXPECTED_ERROR, undefined, 4)
}
}
if (TS.projects.superalgos.globals.taskVariables.FATAL_ERROR_MESSAGE || TS.projects.superalgos.globals.taskVariables.UNEXPECTED_ERROR) {
@@ -1,14 +1,81 @@
exports.newSuperalgosFunctionLibrariesProcessFunctions = function () {
let thisObject = {
processHeartBeat: processHeartBeat,
processHeartBeat: processHeartBeat,
processError: processError,
processWarning: processWarning,
processInfo: processInfo
processInfo: processInfo,
stopProcess: stopProcess
}
return thisObject
function stopProcess(processIndex, callBackFunction, nextLoopTimeoutHandle) {
/* Make sure that the logger associated to this process saves its cache */
TS.projects.superalgos.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.persist()
/* Cancell this process timouput */
clearTimeout(nextLoopTimeoutHandle)
let error = TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).UNEXPECTED_ERROR
if (error !== undefined) {
/*
If the process is finishing with an error, we report it to the UI
and return to the process caller with a FAIL.
*/
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS Process Error - Unexpected Error',
placeholder: {}
}
if (error.message !== undefined) {
docs.placeholder.errorMessage = {
style: 'Error',
text: error.message
}
}
if (error.stack !== undefined) {
docs.placeholder.errorStack = {
style: 'Javascript',
text: error.stack
}
}
if (error.code !== undefined) {
docs.placeholder.errorCode = {
style: 'Json',
text: error.code
}
}
docs.placeholder.errorDetails = {
style: 'Json',
text: JSON.stringify(error, undefined, 4)
}
TS.projects.superalgos.functionLibraries.processFunctions.processError
(
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY,
undefined,
"An unexpected error caused the Process to stop.",
docs
)
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_FAIL_RESPONSE)
} else {
/*
If the process did not finish with an error, we report to the UI that it stopped
and return to the caller with OK.
*/
TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(
TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, 'Stopped')
callBackFunction(TS.projects.superalgos.globals.standardResponses.DEFAULT_OK_RESPONSE)
}
}
function processHeartBeat(processIndex, processingDate, percentage, status) {
let event = {
seconds: (new Date()).getSeconds(),
@@ -19,7 +86,7 @@ exports.newSuperalgosFunctionLibrariesProcessFunctions = function () {
TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(TS.projects.superalgos.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).PROCESS_KEY, 'Heartbeat', event)
}
function processError (processKey, node, errorMessage, docs) {
function processError(processKey, node, errorMessage, docs) {
let event
if (node !== undefined) {
event = {
@@ -38,7 +105,7 @@ exports.newSuperalgosFunctionLibrariesProcessFunctions = function () {
TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(processKey, 'Error', event)
}
function processWarning (processKey, node, warningMessage, docs) {
function processWarning(processKey, node, warningMessage, docs) {
let event
if (node !== undefined) {
event = {
@@ -57,7 +124,7 @@ exports.newSuperalgosFunctionLibrariesProcessFunctions = function () {
TS.projects.superalgos.globals.taskConstants.EVENT_SERVER_CLIENT_MODULE_OBJECT.raiseEvent(processKey, 'Warning', event)
}
function processInfo (processKey, node, infoMessage, docs) {
function processInfo(processKey, node, infoMessage, docs) {
let event
if (node !== undefined) {
event = {
@@ -31,6 +31,8 @@ exports.newSuperalgosGlobalsProcessVariables = function () {
TRADING_PROCESSING_DAILY_FILES When in a trading process, this tell us if we are processing Daily Files or not.
FILE_PATH_ROOT Stores the prefix of the path of any data or log file.
WAIT_FOR_EXECUTION_FINISHED_EVENT This boolean flag tell us if the process waits for an event to continue.
UNEXPECTED_ERROR: When we encounter an error that will produce the Process to be stopped, we store the err object here so that is properties can be extracted for logging purposes.
*/
return thisObject
}
@@ -8,7 +8,7 @@ exports.newSuperalgosGlobalsTaskVariables = function () {
LOGGER_MAP: new Map(), // We will put all the loggers in a map, so that we can eventually finalize them.
SESSION_MAP: new Map(), // We will put all the sessions in a map, so that we can eventually finalize them.
FATAL_ERROR_MESSAGE: undefined,
UNEXPECTED_ERROR: undefined, // This is where we store the latest unexpected task error.
UNEXPECTED_ERROR: undefined, // When we encounter an error that will produce the Task to be stopped, we store the err object here so that is properties can be extracted for logging purposes.
}
return thisObject
@@ -62,6 +62,9 @@ function newSuperalgosDocsCommmandInterface() {
return
}
message = message.replaceAll('#', '_HASHTAG_')
message = message.replaceAll('/', '_SLASH_')
httpRequest(
undefined,
'App/Contribute/' +
@@ -82,7 +85,14 @@ function newSuperalgosDocsCommmandInterface() {
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Message - Contribution Done')
} else {
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Error - Contribution Not Sent', 'Anchor Contribution Not Sent')
UI.projects.superalgos.spaces.docsSpace.navigateTo(
data.docs.project,
data.docs.category,
data.docs.type,
data.docs.anchor,
undefined,
data.docs.placeholder
)
}
}
}
@@ -94,33 +104,6 @@ function newSuperalgosDocsCommmandInterface() {
}
if (UI.projects.superalgos.spaces.docsSpace.commandInterface.command.indexOf('App.Update') !== 0 && UI.projects.superalgos.spaces.docsSpace.commandInterface.command.indexOf('app.update') !== 0) { return 'Not Update Commands' }
/* Set up the commit message */
let message = UI.projects.superalgos.spaces.docsSpace.commandInterface.command.trim().substring(UI.projects.superalgos.spaces.docsSpace.commandInterface.command.indexOf(' ') + 1, UI.projects.superalgos.spaces.docsSpace.commandInterface.command.length)
if (message.toLowerCase() === 'app.update') {
message = 'Updating my Superalgos Fork and local Repository'
}
/* Find the Username and Password */
let apisNode = UI.projects.superalgos.spaces.designSpace.workspace.getHierarchyHeadsByType('APIs')
if (apisNode === undefined) {
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Error - Github Credentials Missing', 'Anchor Hierarchy APIs Not Found')
return
}
if (apisNode.githubAPI === undefined) {
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Error - Github Credentials Missing', 'Anchor Github API Node Not Found')
return
}
let config = JSON.parse(apisNode.githubAPI.config)
if (config.username === undefined || config.username === "") {
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Error - Github Credentials Missing', 'Anchor Config Property Username Not Found')
return
}
if (config.token === undefined || config.token === "") {
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Error - Github Credentials Missing', 'Anchor Config Property Token Not Found')
return
}
httpRequest(undefined, 'App/Update/' + UI.projects.superalgos.spaces.docsSpace.currentBranch, onResponse)
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Message - Updating Your Local App')
@@ -136,7 +119,14 @@ function newSuperalgosDocsCommmandInterface() {
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Message - Update Done - Already Up-To-Date')
}
} else {
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'App Error - Update Failed', 'Anchor Update Failed')
UI.projects.superalgos.spaces.docsSpace.navigateTo(
data.docs.project,
data.docs.category,
data.docs.type,
data.docs.anchor,
undefined,
data.docs.placeholder
)
}
}
}
@@ -21,7 +21,7 @@ function newSuperalgosDocSpace() {
paragraphMap: undefined, // Here we will store a map of paragraphs from the Docs Node, Concept, Topics, Tutorials, Reviews or Books Schema in order to find it when we need to update them.
textArea: undefined,
changeLanguage: changeLanguage,
changeActiveBranch: changeActiveBranch,
changeCurrentBranch: changeCurrentBranch,
changeContributionsBranch: changeContributionsBranch,
enterEditMode: enterEditMode,
exitEditMode: exitEditMode,
@@ -183,7 +183,7 @@ function newSuperalgosDocSpace() {
initialize()
}
function changeActiveBranch(branch) {
function changeCurrentBranch(branch) {
httpRequest(undefined, 'App/Checkout/' + branch, onResponse)
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Changing Current Branch')
@@ -195,7 +195,14 @@ function newSuperalgosDocSpace() {
window.localStorage.setItem('Current Branch', branch)
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Current Branch Changed')
} else {
UI.projects.superalgos.spaces.docsSpace.navigateTo('Superalgos', 'Topic', 'Switching Branches - Current Branch Not Changed')
UI.projects.superalgos.spaces.docsSpace.navigateTo(
data.docs.project,
data.docs.category,
data.docs.type,
data.docs.anchor,
undefined,
data.docs.placeholder
)
}
}
}
@@ -258,6 +265,7 @@ function newSuperalgosDocSpace() {
}
function onClosing() {
thisObject.contextMenu.removeContextMenuFromScreen()
UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered = undefined
thisObject.isVisible = false
}
@@ -476,13 +476,13 @@ function newSuperalgosDocsDocumentPage() {
case "Placeholder": {
renderParagraph(paragraph, key)
editableParagraphIndex++
let error = addPlaceholdedParagraph(paragraph.text)
if (error !== undefined) {
let result = addPlaceholdedParagraph(paragraph.text)
if (result !== undefined) {
paragraph = {
style: "Error",
text: error
style: "Note",
text: result
}
key = 'error-paragraph-' + autoGeneratedParagraphIndex
key = 'note-paragraph-' + autoGeneratedParagraphIndex
renderParagraph(paragraph, key)
autoGeneratedParagraphIndex++
}
@@ -622,14 +622,7 @@ function newSuperalgosDocsDocumentPage() {
autoGeneratedParagraphIndex++
return
} else {
let paragraph = {
type: "Json",
text: JSON.stringify(UI.projects.superalgos.spaces.docsSpace.currentDocumentBeingRendered.placeholder, undefined, 4)
}
let key = 'placeholded-paragraph-' + autoGeneratedParagraphIndex
renderParagraph(paragraph, key)
autoGeneratedParagraphIndex++
return 'Property ' + propertyName + ' not found at the placeholder object.'
return 'Property ' + propertyName + ' not found at the placeholder object. This means that within the info recieved, this information is not available.'
}
}
}
@@ -98,8 +98,8 @@ function newSuperalgosDocsFooter() {
HTML = HTML + '<h4>Choose the Current Branch</h4>'
HTML = HTML + 'You are currently running on the <code class="docs-footer-code">' + UI.projects.superalgos.utilities.gitBranches.getBranchLabel(UI.projects.superalgos.spaces.docsSpace.currentBranch) + '</code> branch. Switch to:'
HTML = HTML + '<ul>'
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeActiveBranch(\'master\')">Master</a></li>'
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeActiveBranch(\'develop\')">Develop</a></li>'
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeCurrentBranch(\'master\')">Master</a></li>'
HTML = HTML + '<li><a href="#" onClick="UI.projects.superalgos.spaces.docsSpace.changeCurrentBranch(\'develop\')">Develop</a></li>'
HTML = HTML + '</ul>'
HTML = HTML + '</div>'
@@ -25,6 +25,7 @@ function newUiObjectMessage() {
thisObject.container.frame.radius = 0
let selfMouseClickEventSubscriptionId
let hoverAnimationCounter = 0
return thisObject
@@ -50,6 +51,7 @@ function newUiObjectMessage() {
function getContainer(point) {
if (thisObject.text === undefined) { return }
if (thisObject.container.frame.isThisPointHere(point, true) === true) {
hoverAnimationCounter = 30
return thisObject.container
} else {
return undefined
@@ -68,6 +70,11 @@ function newUiObjectMessage() {
thisObject.container.frame.width = FRAME_WIDTH
thisObject.container.frame.height = FRAME_HEIGHT
hoverAnimationCounter--
if (hoverAnimationCounter < 0) {
hoverAnimationCounter = 0
}
}
function onMouseClick(event) {
@@ -120,15 +127,29 @@ function newUiObjectMessage() {
}
}
function drawMessageBackground(borderColor) {
function drawMessageBackground(color) {
if (thisObject.text === undefined) { return }
let backgroundColor
let borderColor
let lineWidth
if (hoverAnimationCounter > 0 && thisObject.docs !== undefined) {
backgroundColor = UI_COLOR.LIGHT_GREY
borderColor = color
lineWidth = 2
} else {
backgroundColor = UI.projects.superalgos.spaces.floatingSpace.style.backgroundColor
borderColor = color
lineWidth = 0.5
}
let params = {
cornerRadius: 5,
lineWidth: 0.5,
cornerRadius: 10,
lineWidth: lineWidth,
container: thisObject.container,
borderColor: borderColor,
backgroundColor: UI.projects.superalgos.spaces.floatingSpace.style.backgroundColor,
backgroundColor: backgroundColor,
castShadow: false,
opacity: 0.75
}
@@ -341,7 +341,7 @@ function newSuperalgosTutorialSpace() {
return
}
sliderCounter++
if (sliderCounter === 10 || sliderCounter === 100) {
if (sliderCounter === 1 || sliderCounter === 100) {
switch (config.slider) {
case "toTop": {
@@ -579,11 +579,13 @@ function newSuperalgosTutorialSpace() {
if (timeMachine !== undefined) {
repositionAtTimeMachineCounter++
switch (true) {
case (repositionAtTimeMachineCounter > 0 && repositionAtTimeMachineCounter < 20): {
case (repositionAtTimeMachineCounter > 1 && repositionAtTimeMachineCounter < 20): {
let event = {
delta: -1
}
UI.projects.superalgos.spaces.chartingSpace.viewport.onMouseWheel(event)
for (let i = 0; i < 100; i++) {
UI.projects.superalgos.spaces.chartingSpace.viewport.onMouseWheel(event)
}
break
}
case (repositionAtTimeMachineCounter === 30): {
@@ -621,11 +623,13 @@ function newSuperalgosTutorialSpace() {
if (timeMachine !== undefined) {
repositionAtTimeMachineCounter++
switch (true) {
case (repositionAtTimeMachineCounter > 10 && repositionAtTimeMachineCounter < 20): {
let event = {
delta: -1
case (repositionAtTimeMachineCounter > 1 && repositionAtTimeMachineCounter < 30): {
for (let i = 0; i < 10; i++) {
let event = {
delta: -1
}
UI.projects.superalgos.spaces.chartingSpace.viewport.onMouseWheel(event)
}
UI.projects.superalgos.spaces.chartingSpace.viewport.onMouseWheel(event)
break
}
case (repositionAtTimeMachineCounter === 30): {
@@ -1189,9 +1193,9 @@ function newSuperalgosTutorialSpace() {
syncConfigIconWithDocumentIcon()
transformDocsInfoIntoTutorialInfo()
createTheHTML()
if (nodeConfig.controlDocs !== undefined ) {
if ( nodeConfig.controlDocs.closeTutorialEditor !== true) {
if (nodeConfig.controlDocs !== undefined) {
if (nodeConfig.controlDocs.closeTutorialEditor !== true) {
UI.projects.superalgos.spaces.docsSpace.navigateTo(nodeConfig.docs.project, 'Tutorial', nodeConfig.docs.type)
}
} else {
+3 -3
View File
@@ -48,7 +48,7 @@ Before you begin, it is recommended that you set up Chrome/Safari as your defaul
# Superalgos Client Installation
**1.** Scroll the page all the way to the top. Find and click the **Fork** button to create your fork/copy of this repository. To fork Superalgos you need a GitHub account. If you don't have one, go ahead and create it. A Fork is required for your contributions to the project and to stay up to date with the latest version of the software (more on this later).
**1.** Scroll the page all the way to the top. Find and click the **Fork** button to create your fork/copy of this repository. To fork Superalgos you need a GitHub account. If you don't have one, go ahead and create it. A Fork is required for your contributions to the project (more on this later).
**2.** Once the fork is created, you will land on the page of your fork. Copy the URL from your browser's address bar.
@@ -74,7 +74,7 @@ git clone https://github.com/John/Superalgos
**1.** You need to make a fork so that you may contribute work. Superalgos is a Community project and you are expected to contribute, like everyone else. You don't need to be a technical person to contribute. Fixing a typo in the docs or translating a paragraph into your native language are valuable contributions too. Superalgos has built-in features that make contributing easy. Help make Superalgos better and Superalgos will better serve you! [Free-riding is not cool](https://en.wikipedia.org/wiki/Free-rider_problem), particularly on free, open-source, Community-driven projects.
**2.** You also need a fork to use the in-app self-update feature. It will help you stay up-to-date with the latest version of the software. Updates are on-demand, so don't worry about undesired updates. The project moves very fast and new features become available regularly, particularly if you choose to run the software in the ```develop``` branch (you may switch branches from within the app).
**2.** The software includes an in-app self-update command / feature. It will help you stay up-to-date with the latest version of the software. Updates are on-demand, so don't worry about undesired updates. The project moves very fast and new features become available regularly, particularly if you choose to run the software in the ```develop``` branch (you may switch branches from within the app).
**3.** You are better off running the git clone command as an administrator to avoid permission issues while creating the Superalgos folder and downloading the repository. It may work without admin powers depending on your setup, particularly if you are running the command on a folder where you've got write permissions.
@@ -261,7 +261,7 @@ Superalgos is a Community Project built by Contributors for Contributors. Learn
## Top Contributors
Luis Fernando Molina, Julian Molina, Andreja Cobeljic, Matías Benitez, Ira Miller, Eduardo Remis, Jeff Braun, rico4dev, 9808us, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Norman, Viktoria B., Guillermo V., Daniel J., Javier A., Gustavo J., Romina GS, Pedro P., Thais M., Andrey M., Loui M., Natalia M., Bashar A., Carlos V., Diego M., Sebastian E., Bogdan P., Marko V., Igor S., Niksa K., Rodrigo M., Nicanor M., Alejandro P., Mateo H., Lan T., Leon A., Uroš R., Filip M., Vladimir J. and Pavle B.
Luis Fernando Molina, Julian Molina, Andreja Cobeljic, Matías Benitez, Ira Miller, Eduardo Remis, Jeff Braun, rico4dev, 9808us, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Norman, Viktoria B., Guillermo V., Daniel J., Javier A., Gustavo J., Romina GS, Pedro P., Thais M., Andrey M., Loui M., Natalia M., Bashar A., Carlos V., Diego M., CarnivalBen, Sebastian E., Bogdan P., Marko V., Igor S., Niksa K., Rodrigo M., Nicanor M., Alejandro P., Mateo H., Lan T., Leon A., Uroš R., Filip M., Vladimir J. and Pavle B.
# License
+6 -2
View File
@@ -2,7 +2,7 @@ function newFileStorage(host, port) {
const MODULE_NAME = 'File Storage'
const INFO_LOG = false
const logger = newWebDebugLog()
const MAX_RETRY = 2
let currentRetry = 0
@@ -37,13 +37,17 @@ function newFileStorage(host, port) {
if (pathComplete === false || pathComplete === undefined) {
folder = 'Storage/'
}
let url = folder + filePath
let url
if (host !== undefined && port !== undefined) {
url = 'http://' + host + ':' + port + '/' + folder + filePath
} else {
url = folder + filePath
}
/* Scaping # since it breaks the URL */
url = url.replaceAll('#', '_HASHTAG_')
httpRequest(undefined, url, (response, fileContent) => {
if (response.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE, fileContent)