More Tutorials

This commit is contained in:
Luis Fernando Molina committed 2020-09-30 16:58:51 +02:00
1 parent 81e9db3ceb
commit 39a116d1ef
6 files changed
+51 -25

No files matched your search

+1 -1
View File
@@ -2507,7 +2507,7 @@
"addLeftIcons": true,
"level": 3,
"chainAttachesTo": {
"compatibleTypes": "->Trading Engine->"
"compatibleTypes": "->Trading System->"
},
"propertyNameAtParent": "dynamicIndicators",
"properties": [
Binary file not shown.

After

Width:  |  Height:  |  Size: 317 KiB

+4
View File
@@ -507,6 +507,7 @@ function newCanvas() {
if (event.code === 'Period') {
if (nodeOnFocus !== undefined) {
nodeOnFocus.payload.uiObject.valueAtAngle = false
nodeOnFocus.payload.uiObject.setValue('Id: ' + nodeOnFocus.id)
return
}
@@ -530,6 +531,7 @@ function newCanvas() {
if (nodeUsingThisKey !== undefined && nodeOnFocus !== undefined) {
if (nodeUsingThisKey.id === nodeOnFocus.id) {
nodeOnFocus.payload.uiObject.shortcutKey = ''
nodeOnFocus.payload.uiObject.valueAtAngle = false
nodeOnFocus.payload.uiObject.setValue('Shortcut Key Removed ')
return
} else {
@@ -537,6 +539,7 @@ function newCanvas() {
nodeUsingThisKey.payload.uiObject.shortcutKey = ''
nodeUsingThisKey === undefined
nodeOnFocus.payload.uiObject.shortcutKey = event.key
nodeOnFocus.payload.uiObject.valueAtAngle = false
nodeOnFocus.payload.uiObject.setValue('Shortcut Key: Ctrl + Alt + ' + event.key)
}
}
@@ -546,6 +549,7 @@ function newCanvas() {
if (event.ctrlKey === true && event.altKey === true && nodeOnFocus !== undefined) {
if (nodeOnFocus.payload.uiObject.shortcutKey !== undefined && nodeOnFocus.payload.uiObject.shortcutKey !== '') {
nodeOnFocus.payload.uiObject.valueAtAngle = false
nodeOnFocus.payload.uiObject.setValue('Shortcut Key: Ctrl + Alt + ' + nodeOnFocus.payload.uiObject.shortcutKey)
}
}
+24 -21
View File
@@ -619,7 +619,7 @@ function newUiObject() {
let distance = nearby[0]
let floatingObject = nearby[1]
let nearbyNode = floatingObject.payload.node
if (compatibleTypes.indexOf('->' + nearbyNode.type + '->') >= 0 || compatibleTypes === "->*Any Node*->" ) {
if (compatibleTypes.indexOf('->' + nearbyNode.type + '->') >= 0 || compatibleTypes === "->*Any Node*->") {
if (nodeDefinition.referenceAttachesTo.incompatibleTypes !== undefined) {
if (nodeDefinition.referenceAttachesTo.incompatibleTypes.indexOf('->' + nearbyNode.type + '->') >= 0) {
continue
@@ -982,26 +982,26 @@ function newUiObject() {
eventsServerClient.listenToEvent(key, 'Running', undefined, 'UiObject', onResponse, onRunning)
onRunningCallBackFunction = callBackFunction
function onResponse(message) {
eventSubscriptionIdOnRunning = message.eventSubscriptionId
}
function onRunning() {
if (thisObject.payload === undefined) { return }
let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
eventsServerClient.stopListening(key, eventSubscriptionIdOnRunning, 'UiObject')
thisObject.isRunning = true
if (callBackFunction !== undefined) {
callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
onRunningCallBackFunctionWasCalled = true
}
}
/*
While it is running, it can happen that it naturally stops or is stopped not from the UI but from other means.
In those cases, the stop function would never be called (from the UI). So what we will do is to call it from
@@ -1012,7 +1012,7 @@ function newUiObject() {
If on the other side, it is executed from the UI, then we will be processing the Stopped event twice, which in
both cases will reset the menu item to its default state.
*/
let event = {
type: 'Secondary Action Already Executed'
}
@@ -1022,45 +1022,45 @@ function newUiObject() {
function setupErrorEventListener(callBackFunction) {
let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
eventsServerClient.listenToEvent(key, 'Error', undefined, key, onResponse, onError)
function onResponse(message) {
eventSubscriptionIdOnError = message.eventSubscriptionId
}
function onError(message) {
let uiObject = getTargetUiObject(message)
uiObject.setErrorMessage(message.event.errorMessage, 10)
let event = {
type: 'Secondary Action Already Executed'
}
completeStop(callBackFunction, event)
}
}
function setupWarningEventListener() {
let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
eventsServerClient.listenToEvent(key, 'Warning', undefined, key, onResponse, onWarning)
function onResponse(message) {
eventSubscriptionIdOnWarning = message.eventSubscriptionId
}
function onWarning(message) {
let uiObject = getTargetUiObject(message)
uiObject.setWarningMessage(message.event.warningMessage, 10)
}
}
function setupInfoEventListener() {
let key = thisObject.payload.node.name + '-' + thisObject.payload.node.type + '-' + thisObject.payload.node.id
eventsServerClient.listenToEvent(key, 'Info', undefined, key, onResponse, onInfo)
function onResponse(message) {
eventSubscriptionIdOnInfo = message.eventSubscriptionId
}
function onInfo(message) {
let uiObject = getTargetUiObject(message)
uiObject.setInfoMessage(message.event.infoMessage, 10)
@@ -1600,13 +1600,16 @@ function newUiObject() {
let label
if (radius > 6) {
const MAX_LABEL_LENGTH = 80
const IDEAL_LABEL_LENGTH = 80
label = message
if (label !== undefined && label !== null) {
if (label.length > MAX_LABEL_LENGTH) {
label = label.substring(0, MAX_LABEL_LENGTH) + '...'
if (label.length > IDEAL_LABEL_LENGTH) {
if (label.length > IDEAL_LABEL_LENGTH * 3) {
label = label.substring(0, IDEAL_LABEL_LENGTH * 3) + '...'
}
fontSize = thisObject.payload.floatingObject.currentFontSize * 2 / 4
}
labelPoint = {
+1 -1
View File
@@ -1 +1 @@
{"type":"Workspace","name":"My Default Workspace","rootNodes":[{"type":"Network","name":"My Network","networkNodes":[{"type":"Network Node","name":"My Computer","config":"{ \n\"host\": \"localhost\", \n\"webPort\": \"34248\", \n\"webSocketsPort\": \"8081\"\n}","dataMining":{"type":"Data Mining","name":"New Data Mining","exchangeDataTasks":[{"type":"Exchange Data Tasks","name":"Binance","marketDataTasks":[{"type":"Market Data Tasks","name":"Binance BTC/USDT","dataMineTasks":[{"type":"Data Mine Tasks","name":"Masters","taskManagers":[{"type":"Task Manager","name":"Masters","tasks":[{"type":"Task","name":"Exchange Raw Data","bot":{"type":"Sensor Bot Instance","name":"Exchange Raw Data","config":"{ \n\"startDate\": \"2020-01-01\"\n}","processes":[{"type":"Sensor Process Instance","name":"Exchange Raw Data Historic-OHLCVs","id":"d244c564-4e86-43c7-9796-dc3b6294ec8b","savedPayload":{"position":{"x":23351.26177839097,"y":27974.291647480874},"targetPosition":{"x":23796.669730780435,"y":28201.166946512814},"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":23796.669730780435,"y":28201.166946512814},"targetPosition":{"x":24242.041046879425,"y":28427.957844399567},"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":24242.041046879425,"y":28427.957844399567},"targetPosition":{"x":24687.547900898102,"y":28654.745070559962},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Task","name":"Candles Volumes","bot":{"type":"Indicator Bot Instance","name":"Candles Volumes","config":"{}","processes":[{"type":"Indicator Process Instance","name":"Candles Volumes Multi-Period-Market","id":"f0ef12ed-f0fd-4b88-8e15-27cf24265a5f","savedPayload":{"position":{"x":24007.2915666964,"y":27369.462694439902},"targetPosition":{"x":24378.77789980665,"y":27703.982627430036},"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","id":"7c8b312c-09bf-4c59-853f-1592391a9c57","savedPayload":{"position":{"x":24482.582548441256,"y":27214.951882093752},"targetPosition":{"x":24378.77789980665,"y":27703.982627430036},"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":24378.77789980665,"y":27703.982627430036},"targetPosition":{"x":24533.174985270452,"y":28179.30356647521},"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":24533.094516965724,"y":28179.299752401304},"targetPosition":{"x":24687.547900898102,"y":28654.745070559962},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},{"type":"Task","name":"Resistances and Supports","bot":{"type":"Indicator Bot Instance","name":"Resistances and Supports","config":"{}","processes":[{"type":"Indicator Process Instance","name":"Resistances and Supports Multi-Period-Market","id":"a707814e-b81b-4102-9b5b-4e2fe969324f","savedPayload":{"position":{"x":25115.642796386368,"y":27264.905682019195},"targetPosition":{"x":25141.619360613342,"y":27764.1528195026},"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":"5d9b2729-43fb-4e7e-aa4f-b8477c424e51"}}},{"type":"Indicator Process Instance","name":"Resistances and Supports Multi-Period-Daily","id":"c5395fbe-4b5a-4492-a7fb-e2d259905e27","savedPayload":{"position":{"x":25560.90232900268,"y":27491.92479641827},"targetPosition":{"x":25141.619360613342,"y":27764.1528195026},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"diLine truncated
{"type":"Tutorial","name":"Welcome to Superalgos!","config":"{\n \"title\": \"Congratulations!\",\n \"summary\": \"You are now running Superalgos! Let's get you started! I can't wait to show you around!\",\n \"subTitle\": \"Welcome to Superalgos!\",\n \"gif\": \"\",\n \"image\": \"tutorial\",\n \"definition\": \"I'm an interactive tutorial, the first in a series created to walk you through the basic operation of the system!\",\n \"paragraph1\": \"My goal is to get you started and show you the tools that will help you move around comfortably to discover all the cool things that Superalgos may do for you.\",\n \"callOut\": \"\",\n \"paragraph2\": \"\",\n \"note\": \"\",\n \"tip\": \"Please, always click <b>Next</b> to continue!\",\n \"important\": \"\",\n \"warning\": \"\",\n \"position\": \"\",\n \"slider\": \"toTop\",\n \"documentationURL\": \"\"\n}","tutorialSteps":[],"tutorialTopics":[{"type":"Tutorial Topic","name":"Nodes & Hierarchies","config":"{\n \"position\": \"Left\",\n \"pressButton\": \"Next\",\n \"documentationURL\": \"\"\n}","tutorialSteps":[{"type":"Tutorial Step","name":"That's Me","config":"{\n \"subTitle\": \"That's Me On the Right!\",\n \"gif\": \"\",\n \"image\": \"tutorial\",\n \"definition\": \"Tutorials are defined within the system, so you may create more of us if you wish! But we'll discuss that God-like power later on... let's focus on the basics first!\",\n \"paragraph1\": \"Superalgos is inherently a visual tool. The system represents information in hierarchical structures of interconnected nodes, represented by icons. What you see on your right is one of these hierarchies&mdash;in particular, a ->Tutorial-> hierarchy with a label reading <i>Welcome to Superalgos!</i>\",\n \"callOut\": \"Hover your mouse pointer over the Tutorial node and see what happens!\",\n \"paragraph2\": \"Wow! Cool right? That's a lot of buttons!\",\n \"note\": \"\",\n \"tip\": \"\",\n \"important\": \"\",\n \"warning\": \"\",\n \"position\": \"Left\",\n \"slider\": \"toTop\",\n \"positionAtReferenceParent\": true,\n \"documentationURL\": \"\" \n}","id":"57f5e946-1289-4508-95f0-dfe5e95a7346","savedPayload":{"position":{"x":19822.40872099842,"y":37450.5931430035},"targetPosition":{"x":19389.028279670325,"y":37700.10710421563},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"tutorial":{"status":"Reset"},"referenceParent":{"type":"Tutorial","name":"Welcome to Superalgos!","id":"6f36f540-8de9-4458-b2c7-875884121b87"}}},{"type":"Tutorial Step","name":"Expand That Node!","config":"{\n \"subTitle\": \"Expand That Node!\",\n \"gif\": \"\",\n \"image\": \"expand\",\n \"definition\": \"Each node features a menu. The button on the bottom-left expands and collapses the structure of nodes below the current node.\",\n \"paragraph1\": \"\",\n \"callOut\": \"Go ahead and click the expand button!\",\n \"paragraph2\": \"The ->Tutorial-> node has several offspring, and these have several more offspring. That's why it's a hierarchy!\",\n \"note\": \"Structured visual representations of information are at the core of how Superalgos administers the complexity behind flexible and scalable trading operations.\",\n \"tip\": \"\",\n \"important\": \"\",\n \"warning\": \"\",\n \"position\": \"Left\",\n \"slider\": \"toTop\",\n \"documentationURL\": \"\" \n}","id":"dc75d95f-68d8-44a0-a1d2-d4a12a2fd43f","savedPayload":{"position":{"x":19822.766957335167,"y":37950.07478470893},"targetPosition":{"x":19389.028279670325,"y":37700.10710421563},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"tutorial":{"status":"Reset"}}}],"tutorialTopics":[],"id":"892c8d8c-824e-4293-af86-bdb81464c7d6","savedPayload":{"position":{"x":19389.13197120092,"y":37700.181588867774},"targetPosition":{"x":18888.791666666664,"y":37700.094484167515},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":1,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false},"tutorial":{"status":"Reset"}}},{"type":"Tutorial Topic","name":"Start Data Mining","config":"{\n \"position\": \"Left\",\n \"pressButton\": \"Next\",\n \"documentationURL\": \"\"\n}","tutorialSteps":[{"type":"Tutorial Step","name":"Let's Go for a Ride!","config":"{\n \"subTitle\": \"Let's Go for a Ride!\",\n \"gif\": \"\",\n \"image\": \"network\",\n \"definition\": \"Before I show you the rest of the menu, let's take a look at another hierarchy: the ->Network->. \",\n \"paragraph1\": \"The Network hierarchy is the control room of the system. This is where you control your ->Data Mining->, ->Testing Environment->, and ->Production Environment->.\",\n \"callOut\": \"ExpandLine truncated
@@ -17,6 +17,7 @@ exports.newTradingSystem = function newTradingSystem(bot, logger, tradingEngineM
let tradingSystem
let tradingEngine
let sessionParameters
let dynamicIndicators
const TRADING_STAGES_MODULE = require('./TradingStages.js')
let tradingStagesModule = TRADING_STAGES_MODULE.newTradingStages(bot, logger, tradingEngineModule)
@@ -122,8 +123,26 @@ exports.newTradingSystem = function newTradingSystem(bot, logger, tradingEngineM
tradingStagesModule.updateChart(pChart)
}
function buildDynamicIndicators() {
if (tradingSystem.dynamicIndicators !== undefined) {
dynamicIndicators = {}
/* Eval Dynamic Indicators */
tradingSystem.evalFormulas(tradingSystem.dynamicIndicators, 'Indicator Function')
for (let i = 0; i < tradingSystem.dynamicIndicators.indicatorFunctions.length; i++) {
let indicatorFunction = tradingSystem.dynamicIndicators.indicatorFunctions[i]
if (indicatorFunction.formula === undefined) { return}
if (indicatorFunction.config.codeName === undefined) { return}
dynamicIndicators[indicatorFunction.config.codeName] = tradingSystem.formulas.get(indicatorFunction.formula.id)
}
}
}
async function run() {
try {
/* Dynamic Indicators */
buildDynamicIndicators()
/* Run the Trigger Stage */
tradingStagesModule.runTriggerStage()
@@ -230,7 +249,7 @@ exports.newTradingSystem = function newTradingSystem(bot, logger, tradingEngineM
}
try {
logger.write(MODULE_NAME, '[INFO] evalCondition -> ' + node.name + ' -> code = ' + code)
logger.write(MODULE_NAME, '[INFO] evalCondition -> ' + node.name + ' -> code = ' + code)
value = eval(code)
} catch (err) {
/*
@@ -270,7 +289,7 @@ exports.newTradingSystem = function newTradingSystem(bot, logger, tradingEngineM
let error
try {
logger.write(MODULE_NAME, '[INFO] evalFormula -> ' + node.name + ' -> code = ' + node.code)
logger.write(MODULE_NAME, '[INFO] evalFormula -> ' + node.name + ' -> code = ' + node.code)
value = eval(node.code)
} catch (err) {
/*