Merge branch 'Superalgos:develop' into develop

This commit is contained in:
B Harrell authored and GitHub committed 2021-07-05 18:07:01 -05:00
commit 4eef8b4b0d
19 files changed
+21268 -12213

No files matched your search

+1
View File
@@ -11,3 +11,4 @@ Projects/Foundations/Icons/Thumbs.db
!uninstall-shortcut-windows.bat
*.exe
node_modules
launch.json
+56 -6
View File
@@ -833,9 +833,6 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
} catch (err) {
console.log('[ERROR] httpInterface -> App -> Update -> Method call produced an error.')
console.log('[ERROR] httpInterface -> App -> Update -> err.stack = ' + err.stack)
console.log('[ERROR] httpInterface -> App -> Update -> commitMessage = ' + commitMessage)
console.log('[ERROR] httpInterface -> App -> Update -> username = ' + username)
console.log('[ERROR] httpInterface -> App -> Update -> token = ' + token)
let error = {
result: 'Fail Because',
@@ -892,9 +889,62 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
} catch (err) {
console.log('[ERROR] httpInterface -> App -> Update -> Method call produced an error.')
console.log('[ERROR] httpInterface -> App -> Update -> err.stack = ' + err.stack)
console.log('[ERROR] httpInterface -> App -> Update -> commitMessage = ' + commitMessage)
console.log('[ERROR] httpInterface -> App -> Update -> username = ' + username)
console.log('[ERROR] httpInterface -> App -> Update -> token = ' + token)
let error = {
result: 'Fail Because',
message: err.message,
stack: err.stack
}
respondWithContent(JSON.stringify(error), httpResponse)
}
break
}
case 'Branch': {
try {
branch()
async function branch() {
let result = await doGit()
if (result.error === undefined) {
let customResponse = {
result: global.CUSTOM_OK_RESPONSE.result,
message: result
}
respondWithContent(JSON.stringify(customResponse), httpResponse)
} else {
let docs = {
project: 'Foundations',
category: 'Topic',
type: 'App Error - Could Not Get Current Branch',
anchor: undefined,
placeholder: {}
}
respondWithDocsObject(docs, error)
}
}
async function doGit() {
const simpleGit = require('simple-git');
const options = {
baseDir: process.cwd(),
binary: 'git',
maxConcurrentProcesses: 6,
}
const git = simpleGit(options)
try {
return await git.branch()
} catch (err) {
console.log('[ERROR] Error reading current branch.')
console.log(err.stack)
}
}
} catch (err) {
console.log('[ERROR] httpInterface -> App -> Update -> Method call produced an error.')
console.log('[ERROR] httpInterface -> App -> Update -> err.stack = ' + err.stack)
let error = {
result: 'Fail Because',
@@ -101,22 +101,31 @@ function newEducationDocSpace() {
Getting the currentBranch
*/
let workspace = UI.projects.foundations.spaces.designSpace.workspace.workspaceNode
let currentBranch = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(workspace.payload, 'currentBranch')
if (currentBranch === undefined) {
UI.projects.foundations.utilities.nodeConfig.saveConfigProperty(workspace.payload, 'currentBranch', UI.projects.education.globals.docs.DEFAULT_CURRENT_BRANCH)
UI.projects.education.spaces.docsSpace.currentBranch = UI.projects.education.globals.docs.DEFAULT_CURRENT_BRANCH
} else {
UI.projects.education.spaces.docsSpace.currentBranch = currentBranch
}
/*
Every time this setup occurs, we will automatically change to the currentBranch of the workspace.
*/
//changeCurrentBranch(UI.projects.education.spaces.docsSpace.currentBranch, true)
httpRequest(undefined, 'App/Branch', onResponse)
/*
Deleting what was is here because is not longer used...
*/
window.localStorage.removeItem('Current Branch')
UI.projects.foundations.utilities.nodeConfig.saveConfigProperty(workspace.payload, 'currentBranch', undefined)
function onResponse(err, data) {
/* Lets check the result of the call through the http interface */
data = JSON.parse(data)
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result && data.result === GLOBAL.CUSTOM_OK_RESPONSE.result) {
let currentBranch = data.message.current
UI.projects.education.spaces.docsSpace.currentBranch = currentBranch
} else {
UI.projects.education.spaces.docsSpace.navigateTo(
data.docs.project,
data.docs.category,
data.docs.type,
data.docs.anchor,
undefined,
data.docs.placeholder
)
}
}
}
function setupContributionsBranch() {
@@ -0,0 +1 @@
{"type":"Data Mine","name":"Barcelona","config":"{\n \"codeName\": \"Barcelona\"\n}","project":"Superalgos","sensorBots":[],"apiDataFetcherBots":[],"indicatorBots":[{"type":"Indicator Bot","name":"Koncorde","config":"{\n \"codeName\": \"Koncorde\"\n}","project":"Superalgos","processes":[{"type":"Process Definition","name":"Multi-Time-Frame-Market","config":"{\n \"codeName\": \"Multi-Time-Frame-Market\",\n \"description\": \"Produces the Positives Volume Index\",\n \"deadWaitTime\": 0,\n \"normalWaitTime\": 0,\n \"retryWaitTime\": 10000,\n \"sleepWaitTime\": 3600000,\n \"comaWaitTime\": 86400000,\n \"framework\": {\n \"name\": \"Multi-Time-Frame-Market\"\n }\n}","project":"Superalgos","processOutput":{"type":"Process Output","name":"New Process Output","project":"Superalgos","outputDatasets":[{"type":"Output Dataset","name":"Multi-Time-Frame-Market Koncorde","project":"Superalgos","id":"ab0f392d-6026-43e9-8b61-4e92e88524c4","savedPayload":{"position":{"x":16599.51846545005,"y":17934.337475957647},"targetPosition":{"x":16788.314582765004,"y":18167.481264394737},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Time-Frame-Market","id":"7efa0604-7f1c-49f1-86e8-0c9daed5a9a8"}}},{"type":"Output Dataset","name":"Multi-Time-Frame-Market Koncorde patterns","project":"Superalgos","id":"67eca77a-409c-400f-ba7b-2a5863f51698","savedPayload":{"position":{"x":16741.384243252935,"y":17871.174762216197},"targetPosition":{"x":16788.314582765004,"y":18167.481264394737},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":3,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Time-Frame-Market","id":"0a0bf5f9-f974-4954-bb86-a562e52ea6be"}}}],"outputDatasetFolders":[],"id":"25147868-75ac-4e91-9ac6-603e4c927339","savedPayload":{"position":{"x":16788.314582765004,"y":18167.481264394737},"targetPosition":{"x":16910.335575687743,"y":18441.544901687517},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{"isRunning":false}}},"processDependencies":{"type":"Process Dependencies","name":"New Process Dependencies","project":"Superalgos","statusDependencies":[{"type":"Status Dependency","name":"","config":"{\n \"mainUtility\": \"Market Ending Point\"\n}","project":"Superalgos","id":"daf1efc3-abc3-466d-9e57-f61c97795e90","savedPayload":{"position":{"x":16830.22239084643,"y":18042.818742123207},"targetPosition":{"x":16941.69411466804,"y":18143.188333077036},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"a0a61ba9-91cb-4ec7-92fe-134ff079de2d"}}},{"type":"Status Dependency","name":"","config":"{\n \"mainUtility\": \"Self Reference\"\n}","project":"Superalgos","id":"6ed24b0b-2357-4d08-aad5-4ab35c386869","savedPayload":{"position":{"x":16910.507361045376,"y":17996.466192966964},"targetPosition":{"x":16941.69411466804,"y":18143.188333077036},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Status Report","name":"New Status Report","id":"77232d10-26e4-407e-9d71-c2e65e2b0adb"}}}],"dataDependencies":[{"type":"Data Dependency","name":"Candles Multi-Time-Frame-Market","project":"Superalgos","id":"b56e3866-b8be-4595-830c-9f10941fd8c3","savedPayload":{"position":{"x":17002.70461112941,"y":18006.156514430644},"targetPosition":{"x":16941.69411466804,"y":18143.188333077036},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Time-Frame-Market","id":"2b03494a-67d6-47f1-89b6-53fc4c9116a8"}}},{"type":"Data Dependency","name":"Volumes Multi-Time-Frame-Market","project":"Superalgos","id":"2008bb63-8ba5-403e-b8be-92ced1ee6580","savedPayload":{"position":{"x":17071.597925235706,"y":18068.188333077036},"targetPosition":{"x":16941.69411466804,"y":18143.188333077036},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":2,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Time-Frame-Market","id":"9bf0483c-4825-4a46-9cf4-1b5262579fc1"}}}],"dataMineDataDependencies":[],"id":"2db19ce5-b28f-4d91-9b9e-05861e3408f2","savedPayload":{"position":{"x":16941.69411466804,"y":18143.188333077036},"targetPosition":{"x":16910.335575687743,"y":18441.544901687517},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParenLine truncated
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -1,148 +1,148 @@
{
"type": "Crypto Exchange",
"menuItems": [
{
"action": "Configure Thise",
"actionFunction": "uiObject.configEditor.activate",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration"
},
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "exchangeAssets",
"label": "Add Exchange Assets",
"relatedUiObject": "Exchange Assets",
"actionFunction": "payload.executeAction"
},
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "exchangeMarkets",
"label": "Add Exchange Markets",
"relatedUiObject": "Exchange Markets",
"actionFunction": "payload.executeAction"
},
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "exchangeAccounts",
"label": "Add Exchange Accounts",
"relatedUiObject": "Exchange Accounts",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
}
],
"isTitleAllwaysVisible": true,
"addLeftIcons": true,
"level": 2,
"editors": {
"config": true
"type": "Crypto Exchange",
"menuItems": [
{
"action": "Configure Thise",
"actionFunction": "uiObject.configEditor.activate",
"label": "Configure",
"iconPathOn": "configuration",
"iconPathOff": "configuration"
},
"initialValues": {
"config": "{ \n\"codeName\": \"Type the name of the exchange\"\n}"
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "exchangeAssets",
"label": "Add Exchange Assets",
"relatedUiObject": "Exchange Assets",
"actionFunction": "payload.executeAction"
},
"attachingRules": {
"compatibleTypes": "->Crypto Exchanges->"
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "exchangeMarkets",
"label": "Add Exchange Markets",
"relatedUiObject": "Exchange Markets",
"actionFunction": "payload.executeAction"
},
"propertyNameAtParent": "exchanges",
"childrenNodesProperties": [
{
"name": "exchangeAssets",
"type": "node",
"childType": "Exchange Assets",
"autoAdd": true
},
{
"name": "exchangeMarkets",
"type": "node",
"childType": "Exchange Markets",
"autoAdd": true
},
{
"name": "exchangeAccounts",
"type": "node",
"childType": "Exchange Accounts",
"autoAdd": true
}
],
"alternativeIcons": [
{
"codeName": "binance",
"iconName": "binance"
},
{
"codeName": "binanceus",
"iconName": "binanceus"
},
{
"codeName": "bitfinex",
"iconName": "bitfinex"
},
{
"codeName": "bitmex",
"iconName": "bitmex"
},
{
"codeName": "bittrex",
"iconName": "bittrex"
},
{
"codeName": "coinbasepro",
"iconName": "coinbasepro"
},
{
"codeName": "ftx",
"iconName": "ftx"
},
{
"codeName": "hitbtc",
"iconName": "hitbtc"
},
{
"codeName": "kraken",
"iconName": "kraken"
},
{
"codeName": "kucoin",
"iconName": "kucoin"
},
{
"codeName": "liquid",
"iconName": "liquid"
},
{
"codeName": "luno",
"iconName": "luno"
},
{
"codeName": "lykke",
"iconName": "lykke"
},
{
"codeName": "okex",
"iconName": "okex"
},
{
"codeName": "okex5",
"iconName": "okex"
},
{
"codeName": "poloniex",
"iconName": "poloniex"
},
{
"codeName": "upbit",
"iconName": "upbit"
}
]
}
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "exchangeAccounts",
"label": "Add Exchange Accounts",
"relatedUiObject": "Exchange Accounts",
"actionFunction": "payload.executeAction"
},
{
"action": "Delete UI Object",
"askConfirmation": true,
"confirmationLabel": "Confirm to Delete",
"label": "Delete",
"iconPathOn": "delete-entity",
"iconPathOff": "delete-entity",
"actionFunction": "payload.executeAction"
}
],
"isTitleAllwaysVisible": true,
"addLeftIcons": true,
"level": 2,
"editors": {
"config": true
},
"initialValues": {
"config": "{ \n\"codeName\": \"Type the name of the exchange\",\n \n\"sandBox\": \"false\"\n}"
},
"attachingRules": {
"compatibleTypes": "->Crypto Exchanges->"
},
"propertyNameAtParent": "exchanges",
"childrenNodesProperties": [
{
"name": "exchangeAssets",
"type": "node",
"childType": "Exchange Assets",
"autoAdd": true
},
{
"name": "exchangeMarkets",
"type": "node",
"childType": "Exchange Markets",
"autoAdd": true
},
{
"name": "exchangeAccounts",
"type": "node",
"childType": "Exchange Accounts",
"autoAdd": true
}
],
"alternativeIcons": [
{
"codeName": "binance",
"iconName": "binance"
},
{
"codeName": "binanceus",
"iconName": "binanceus"
},
{
"codeName": "bitfinex",
"iconName": "bitfinex"
},
{
"codeName": "bitmex",
"iconName": "bitmex"
},
{
"codeName": "bittrex",
"iconName": "bittrex"
},
{
"codeName": "coinbasepro",
"iconName": "coinbasepro"
},
{
"codeName": "ftx",
"iconName": "ftx"
},
{
"codeName": "hitbtc",
"iconName": "hitbtc"
},
{
"codeName": "kraken",
"iconName": "kraken"
},
{
"codeName": "kucoin",
"iconName": "kucoin"
},
{
"codeName": "liquid",
"iconName": "liquid"
},
{
"codeName": "luno",
"iconName": "luno"
},
{
"codeName": "lykke",
"iconName": "lykke"
},
{
"codeName": "okex",
"iconName": "okex"
},
{
"codeName": "okex5",
"iconName": "okex"
},
{
"codeName": "poloniex",
"iconName": "poloniex"
},
{
"codeName": "upbit",
"iconName": "upbit"
}
]
}
@@ -9,7 +9,7 @@
"config": true
},
"initialValues": {
"config": "{\"node\":{\"distancePercentage\":60,\"radiusPercentage\":85,\"massPercentage\":100,\"animationSteps\":2,\"menuItem\":{\"widthPercentage\":100,\"heightPercentage\":60,\"radiusPercentage\":90}},\"physics\":false,\"detachUsingMouse\":false }"
"config": "{\"node\":{\"distancePercentage\":60,\"radiusPercentage\":85,\"massPercentage\":100,\"animationSteps\":2,\"menuItem\":{\"widthPercentage\":100,\"heightPercentage\":60,\"radiusPercentage\":90}},\"physics\":false,\"shortcuts\":{\"toggleMapMode\":\"M\",\"toggleDrawRelationshipLines\":\"R\",\"toggleDrawParentLines\":\"C\",\"saveWorkspace\":\"S\",\"adjustAspectRatio\":\"A\"}}"
},
"menuItems": [
{
@@ -1,83 +1,87 @@
{
"type": "Crypto Exchange",
"definition": {
"text": "A crypto exchange node holds the definitions of assets and markets in a specific exchange."
"type": "Crypto Exchange",
"definition": {
"text": "A crypto exchange node holds the definitions of assets and markets in a specific exchange."
},
"paragraphs": [
{
"style": "Block",
"text": "Configuring"
},
"paragraphs": [
{
"style": "Block",
"text": "Configuring"
},
{
"style": "Title",
"text": "Tested Exchanges",
"updated": 1615200855230
},
{
"style": "Text",
"text": "In theory, Superalgos supports dozens of exchanges. However, each exchange must go through a testing process, as not all of them conform to the standard proposed by the CCXT library.",
"updated": 1615201479524
},
{
"style": "List",
"text": "Binance Test Status",
"updated": 1615203667257
},
{
"style": "List",
"text": "Binance-US Test Status"
},
{
"style": "List",
"text": "Bitfinex Test Status"
},
{
"style": "List",
"text": "Bittrex Test Status"
},
{
"style": "List",
"text": "CoinbasePro Test Status"
},
{
"style": "List",
"text": "FTX Test Status",
"updated": 1615203669878
},
{
"style": "List",
"text": "Kraken Test Status",
"updated": 1615453046113
},
{
"style": "List",
"text": "Kucoin Test Status"
},
{
"style": "List",
"text": "Luno Test Status"
},
{
"style": "Title",
"text": "Crypto Exchange Configuration"
},
{
"style": "Text",
"text": "Each exchange may require a very specific configuration. This is determined during the exchange testing process. Consult the page of each exchange as listed above. If you are interested in testing a new exchange, go to the How to Test New Exchanges page.",
"updated": 1615201685376
},
{
"style": "Subtitle",
"text": "Properties",
"updated": 1609771684679
},
{
"style": "List",
"text": "codeName is the name of the exchange as handled in the code of the system."
},
{
"style": "List",
"text": "API holds a series of definitions used only in the case in which the sensor bot fetches trades (using the Historic-Trades process) instead of the OHLCV process that fetches one-minute candles and is the current default. In such a case, finding the right set of parameters to work with a specific exchange may be challenging, nd involves understanding how the exchanges API and the CCXT Library API work. In other words, there is no hard rule as of what each of the values should be. Determining each of this values requires exploring the exchange's API documentation, as well as the documentation of the CCXT Library."
}
]
}
{
"style": "Title",
"text": "Tested Exchanges",
"updated": 1615200855230
},
{
"style": "Text",
"text": "In theory, Superalgos supports dozens of exchanges. However, each exchange must go through a testing process, as not all of them conform to the standard proposed by the CCXT library.",
"updated": 1615201479524
},
{
"style": "List",
"text": "Binance Test Status",
"updated": 1615203667257
},
{
"style": "List",
"text": "Binance-US Test Status"
},
{
"style": "List",
"text": "Bitfinex Test Status"
},
{
"style": "List",
"text": "Bittrex Test Status"
},
{
"style": "List",
"text": "CoinbasePro Test Status"
},
{
"style": "List",
"text": "FTX Test Status",
"updated": 1615203669878
},
{
"style": "List",
"text": "Kraken Test Status",
"updated": 1615453046113
},
{
"style": "List",
"text": "Kucoin Test Status"
},
{
"style": "List",
"text": "Luno Test Status"
},
{
"style": "Title",
"text": "Crypto Exchange Configuration"
},
{
"style": "Text",
"text": "Each exchange may require a very specific configuration. This is determined during the exchange testing process. Consult the page of each exchange as listed above. If you are interested in testing a new exchange, go to the How to Test New Exchanges page.",
"updated": 1615201685376
},
{
"style": "Subtitle",
"text": "Properties",
"updated": 1609771684679
},
{
"style": "List",
"text": "codeName is the name of the exchange as handled in the code of the system."
},
{
"style": "List",
"text": "sandBox setting this parameter to true allows SuperAlgos to perform live trading on the exchanges sandbox or testnet if one is available."
},
{
"style": "List",
"text": "API holds a series of definitions used only in the case in which the sensor bot fetches trades (using the Historic-Trades process) instead of the OHLCV process that fetches one-minute candles and is the current default. In such a case, finding the right set of parameters to work with a specific exchange may be challenging, nd involves understanding how the exchanges API and the CCXT Library API work. In other words, there is no hard rule as of what each of the values should be. Determining each of this values requires exploring the exchange's API documentation, as well as the documentation of the CCXT Library."
}
]
}
@@ -59,6 +59,45 @@
{
"style": "List",
"text": "detachUsingMouse defines if you can detach nodes from it's parent or reference parents only using the mouse (when true) or if you can not use the mouse for that and can only do it using the detach buttons on the icon's menu (when false)."
},
{
"style": "Subtitle",
"text": "Shorcut Properties"
},
{
"style": "Text",
"text": "Shorcuts are key stroke combinations that helps users execute certain actions very quickly. To execute a shorcut users need to simultaniously press CTRL + SHIFT + a pre-defined key.",
"updated": 1625419324367
},
{
"style": "Success",
"text": "Shorcuts default values can be seen below. You can modify those values by changing the Config Properties listed below.",
"updated": 1625419754545
},
{
"style": "List",
"text": "toggleMapMode defines which key will be used as a Shorcut for entering and leaving the Map Mode.",
"updated": 1625419803171
},
{
"style": "List",
"text": "toggleDrawRelationshipLines defines which key will be used as a Shorcut for turning on and off the drawing of Reference Lines.",
"updated": 1625419810253
},
{
"style": "List",
"text": "toggleDrawParentLines defines which key will be used as a Shorcut for turning on and off the drawing of Parent Lines.",
"updated": 1625419816654
},
{
"style": "List",
"text": "saveWorkspace defines which key will be used as a Shorcut for saving the Workspace.",
"updated": 1625419822252
},
{
"style": "List",
"text": "adjustAspectRation defines which key will be used as a Shorcut for forcing a Time Machine to adjust it's aspect ratio according to the size of the screen a user currently have.",
"updated": 1625419830418
}
]
}
@@ -0,0 +1,85 @@
{
"topic": "App Commands Errors",
"pageNumber": "3",
"type": "App Error - Could Not Get Current Branch",
"definition": {
"text": "There was a problem trying to get the Current Branch. Check the console for errors.",
"updated": 1611129344277
},
"paragraphs": [
{
"style": "Success",
"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 information recorded when the error occurred."
},
{
"style": "Note",
"text": "You will only see the information if you opened this page as a result of the error actually occurring.",
"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 following 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 following are all the Error details of the Exception that occured at the Client:"
},
{
"style": "Placeholder",
"text": "errorDetails"
},
{
"style": "Text",
"text": ""
}
]
}
@@ -104,7 +104,41 @@
},
{
"style": "Javascript",
"text": "candle.close = candle.open (neutral candle)"
"text": "candle.close = candle.open (neutral candle)",
"updated": 1625193523044
},
{
"style": "Text",
"text": "Full example:",
"updated": 1625193592583
},
{
"style": "Javascript",
"text": "chart.at01hs.candle.close",
"updated": 1625193572334
},
{
"style": "Table",
"text": "| Product Name | Product Variable | Property Variables |\n| Candles | candles | |",
"updated": 1625193681925
},
{
"style": "Text",
"text": "The candles property returns an array of all candles that have been loaded into memory. You can access specific candles using it's index. ",
"updated": 1625193832157
},
{
"style": "Text",
"text": "For example:"
},
{
"style": "Javascript",
"text": "chart.at01hs.candles[1]"
},
{
"style": "Text",
"text": "From there you may access the specific data held within each candle.",
"updated": 1625193896081
},
{
"style": "Subtitle",
@@ -34,8 +34,8 @@
},
{
"style": "Javascript",
"text": "docs.add Review to Superalgos: Superalgos Project Review->Superalgos Review - Your Review Title",
"updated": 1616878234259
"text": "docs.add Review to Foundations: Superalgos Project Review->Superalgos Review - Your Review Title",
"updated": 1625193020331
},
{
"style": "List",
@@ -1,7 +1,7 @@
exports.newFoundationsBotModulesExchangeAPI = function (processIndex) {
let MODULE_NAME = "Exchange API";
let thisObject = {
getOrder: getOrder,
createOrder: createOrder,
@@ -9,27 +9,28 @@
initialize: initialize,
finalize: finalize
};
let tradingSystem
let exchangeId
let options = {}
let exchange
const ccxt = require('ccxt')
return thisObject;
function initialize() {
tradingSystem = TS.projects.foundations.globals.processVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).SIMULATION_STATE.tradingSystem
exchangeId = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.codeName
let key
let secret
let uid
let password
let sandBox = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.config.sandbox || false;
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference !== undefined) {
if (TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference.referenceParent !== undefined) {
key = TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference.referenceParent.config.codeName
@@ -51,33 +52,40 @@
options: options
}
exchange = new exchangeClass(exchangeConstructorParams)
// enable sandbox mode based on exchange sandbox param value
if (sandBox) {
exchange.setSandboxMode(sandBox);
}
console.log('Sandbox mode = ' + sandBox);
// uncomment the following line if you want to log the exchange api being used
// console.log(exchange.urls.api);
}
function finalize() {
tradingSystem = undefined
exchangeId = undefined
options = undefined
exchange = undefined
}
async function getOrder(tradingSystemOrder, tradingEngineOrder) {
let orderId = tradingEngineOrder.exchangeId.value
const symbol = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName + '/' + TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName
/* Basic Logging */
logInfo("getOrder -> orderId = " + orderId)
logInfo("getOrder -> symbol = " + symbol)
/* Basic Validations */
if (exchange.has['fetchOrder'] === false) {
logError("getOrder -> Exchange does not support fetchOrder command.");
return
}
try {
let order = await exchange.fetchOrder(orderId, symbol)
logInfo("getOrder -> Response from the Exchange: " + JSON.stringify(order));
return order
} catch (err) {
@@ -92,13 +100,13 @@
symbol: symbol,
orderId: orderId
}
TS.projects.education.utilities.docsFunctions.buildPlaceholder(docs, err, tradingSystemOrder.name, undefined, undefined, undefined, contextInfo)
tradingSystem.addError([tradingSystemOrder.id, message, docs])
logError("getOrder -> Error = " + err.message);
if ( /[0-9a-z]+ NotFound/.test(err.message) ) {
if (/[0-9a-z]+ NotFound/.test(err.message)) {
logInfo("getOrder -> NotFound, so order is actually closed.")
order = {
status: 'NotFound'
@@ -107,15 +115,15 @@
}
}
}
async function createOrder(tradingSystemOrder, tradingEngineOrder) {
let price = tradingEngineOrder.rate.value // CCXT: how much quote currency you are willing to pay for a trade lot of base currency (for limit orders only)
let type // CCXT: a string literal type of order, ccxt currently unifies market and limit orders only
let side // CCXT: a string literal for the direction of your order, buy or sell
let symbol = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName + '/' + TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName // CCXT: a string literal symbol of the market you wish to trade on, like BTC/USD, ZEC/ETH, DOGE/DASH, etc
let amount = tradingEngineOrder.orderBaseAsset.size.value // CCXT: how much of currency you want to trade, in Base Asset.
switch (tradingSystemOrder.type) {
case 'Market Buy Order': {
type = 'market'
@@ -138,14 +146,14 @@
break
}
}
/* Basic Logging */
logInfo("createOrder -> symbol = " + symbol);
logInfo("createOrder -> side = " + side);
logInfo("createOrder -> type = " + type);
logInfo("createOrder -> amount = " + amount);
logInfo("createOrder -> price = " + price);
/* Basic Validations */
if (side !== "buy" && side !== "sell") {
logError("createOrder -> side must be either 'buy' or 'sell'.");
@@ -155,17 +163,17 @@
logError("createOrder -> Exchange does not support createOrder command.");
return
}
try {
let order = await (exchange.createOrder(symbol, type, side, amount, price))
logInfo("createOrder -> Response from the Exchange: " + JSON.stringify(order));
return order.id
} catch (err) {
let exchangeApiKey = TS.projects.foundations.globals.taskConstants.TASK_NODE.keyReference.referenceParent
let message = 'Create Order Unexpected Error'
logError("createOrder -> Error = " + err.message)
logError("createOrder -> symbol = " + symbol);
logError("createOrder -> side = " + side);
@@ -179,7 +187,7 @@
) {
logError('The exchange says the API key provided is not good or it is not in the correct format. This is what you are using:')
errorFooter()
message = 'Invalid Exchange API Key'
}
if (
@@ -188,17 +196,17 @@
) {
logError('The exchange says the secret provided is not good, incorrect or not in the correct format. This is what you are using:')
errorFooter()
message = 'Invalid Exchange API Secret'
}
let docs = {
project: 'Foundations',
category: 'Topic',
type: 'TS LF Trading Bot Error - ' + message,
placeholder: {}
}
let contextInfo = {
symbol: symbol,
side: side,
@@ -211,9 +219,9 @@
secretLength: exchangeApiKey.config.secret.length
}
TS.projects.education.utilities.docsFunctions.buildPlaceholder(docs, err, exchangeApiKey.name, undefined, exchangeApiKey.config, undefined, contextInfo)
tradingSystem.addError([exchangeApiKey.id, message, docs])
function errorFooter() {
logError('key: ->' + exchangeApiKey.config.codeName + '<-')
logError('secret: ->' + exchangeApiKey.config.secret + '<-')
@@ -224,25 +232,25 @@
}
}
}
async function cancelOrder(tradingSystemOrder, tradingEngineOrder) {
let orderId = tradingEngineOrder.exchangeId.value
/* Basic Logging */
logInfo("cancelOrder -> Entering function. orderId = " + orderId);
const symbol = TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName + '/' + TS.projects.foundations.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName
/* Basic Validations */
if (exchange.has['fetchOrder'] === false) {
logError("cancelOrder -> Exchange does not support fetchOrder command.");
return
}
try {
let order = await exchange.cancelOrder(orderId, symbol)
logInfo("cancelOrder -> Response from the Exchange: " + JSON.stringify(order));
return true
} catch (err) {
@@ -257,19 +265,20 @@
symbol: symbol,
orderId: orderId
}
TS.projects.education.utilities.docsFunctions.buildPlaceholder(docs, err, tradingSystemOrder.name, undefined, undefined, undefined, contextInfo)
tradingSystem.addError([tradingSystemOrder.id, message, docs])
logError("cancelOrder -> Error = " + err.message);
}
}
function logInfo(message) {
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[INFO] ' + message)
}
function logError(message) {
TS.projects.foundations.globals.loggerVariables.VARIABLES_BY_PROCESS_INDEX_MAP.get(processIndex).BOT_MAIN_LOOP_LOGGER_MODULE_OBJECT.write(MODULE_NAME, '[ERROR] ' + message)
}
};
};
@@ -186,9 +186,9 @@ function newEdgeEditor() {
function onKeyPressed(event, forceExecution) {
if (forceExecution !== true) {
if (whereIsMouseOver !== 'center' ) {return}
if (whereIsMouseOver !== 'center') { return }
}
const STEP = 10
if (event.shiftKey === false && event.ctrlKey === false && event.code === 'ArrowLeft') {
@@ -228,7 +228,11 @@ function newEdgeEditor() {
return
}
if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'A' || event.key === 'a')) {
if (
event.shiftKey === true &&
(event.ctrlKey === true || event.metaKey === true) &&
(event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.adjustAspectRatio || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.adjustAspectRatio.toLowerCase())
) {
resetAspectRatio()
return
}
@@ -100,7 +100,14 @@ function newFoundationsFloatingSpace() {
}
},
physics: true,
detachUsingMouse: false
detachUsingMouse: false,
shortcuts: {
toggleMapMode: "M",
toggleDrawRelationshipLines: "R",
toggleDrawParentLines: "C",
saveWorkspace: "S",
adjustAspectRatio: "A"
}
}
return thisObject
@@ -540,6 +547,23 @@ function newFoundationsFloatingSpace() {
if (configSettings.detachUsingMouse !== undefined) {
thisObject.settings.detachUsingMouse = configSettings.detachUsingMouse
}
if (configSettings.shortcuts !== undefined) {
if (configSettings.shortcuts.toggleMapMode !== undefined) {
thisObject.settings.shortcuts.toggleMapMode = configSettings.shortcuts.toggleMapMode
}
if (configSettings.shortcuts.toggleDrawRelationshipLines !== undefined) {
thisObject.settings.shortcuts.toggleDrawRelationshipLines = configSettings.shortcuts.toggleDrawRelationshipLines
}
if (configSettings.shortcuts.toggleDrawParentLines !== undefined) {
thisObject.settings.shortcuts.toggleDrawParentLines = configSettings.shortcuts.toggleDrawParentLines
}
if (configSettings.shortcuts.saveWorkspace !== undefined) {
thisObject.settings.shortcuts.saveWorkspace = configSettings.shortcuts.saveWorkspace
}
if (configSettings.shortcuts.adjustAspectRatio !== undefined) {
thisObject.settings.shortcuts.adjustAspectRatio = configSettings.shortcuts.adjustAspectRatio
}
}
}
function positionContraintsPhysics() {
@@ -1,7 +1,7 @@
{
"type": "Workspace",
"name": "Token-Distribution-Superalgos",
"config": "{\n \"docsLanguage\": \"EN\",\n \"currentBranch\": \"develop\",\n \"contributionsBranch\": \"develop\"\n}",
"config": "{\n \"docsLanguage\": \"EN\",\n \"contributionsBranch\": \"develop\"\n}",
"rootNodes": [
{
"type": "Design Space",
@@ -148,7 +148,7 @@
"spaceSettings": {
"type": "Space Settings",
"name": "New Space Settings",
"config": "{\n \"indexContent\": true\n}",
"config": "{\n \"indexContent\": false\n}",
"project": "Foundations",
"id": "4124c674-c5fe-41d9-94b9-d669753188b7",
"savedPayload": {
@@ -782,7 +782,7 @@
{
"type": "Plugin File",
"name": "harrellbm",
"config": "{\"project\":\"Governance\",\"fileName\":\"harrellbm\",\"folderName\":\"User-Profiles\",\"nodeType\":\"User Profile\"}",
"config": "{\n \"project\": \"Governance\",\n \"fileName\": \"harrellbm\",\n \"folderName\": \"User-Profiles\",\n \"nodeType\": \"User Profile\"\n}",
"project": "Foundations",
"pluginFilePosition": {
"type": "Plugin File Position",
@@ -824,7 +824,7 @@
"floatingObject": {
"isPinned": false,
"isFrozen": false,
"isCollapsed": false,
"isCollapsed": true,
"angleToParent": 2,
"distanceToParent": 3,
"arrangementStyle": 0
@@ -1364,7 +1364,7 @@
"githubAPI": {
"type": "Github API",
"name": "New Github API",
"config": "{\n \"username\": \"Luis-Fernando-Molina\",\n \"token\": \"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\"\n}",
"config": "{\n \"username\": \"\",\n \"token\": \"\"\n}",
"project": "Foundations",
"id": "90d121ab-9f19-4437-a051-1222287085fc",
"savedPayload": {
+20 -4
View File
@@ -415,25 +415,41 @@ function newCanvas() {
UI.projects.foundations.spaces.floatingSpace.exitMapMode()
}
if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'M' || event.key === 'm')) {
if (
event.shiftKey === true &&
(event.ctrlKey === true || event.metaKey === true) &&
(event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.toggleMapMode || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.toggleMapMode.toLowerCase())
) {
UI.projects.foundations.spaces.floatingSpace.toggleMapMode()
event.preventDefault()
return
}
if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'R' || event.key === 'r')) {
if (
event.shiftKey === true &&
(event.ctrlKey === true || event.metaKey === true) &&
(event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.toggleDrawRelationshipLines || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.toggleDrawRelationshipLines.toLowerCase())
) {
UI.projects.foundations.spaces.floatingSpace.toggleDrawReferenceLines()
event.preventDefault()
return
}
if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'C' || event.key === 'c')) {
if (
event.shiftKey === true &&
(event.ctrlKey === true || event.metaKey === true) &&
(event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.toggleDrawParentLines || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.toggleDrawParentLines.toLowerCase())
) {
UI.projects.foundations.spaces.floatingSpace.toggleDrawChainLines()
event.preventDefault()
return
}
if (event.shiftKey === true && (event.ctrlKey === true || event.metaKey === true) && (event.key === 'S' || event.key === 's')) {
if (
event.shiftKey === true &&
(event.ctrlKey === true || event.metaKey === true) &&
(event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.saveWorkspace || event.key === UI.projects.foundations.spaces.floatingSpace.settings.shortcuts.saveWorkspace.toLowerCase())
) {
UI.projects.foundations.spaces.designSpace.workspace.save()
if (event.preventDefault !== undefined) {
event.preventDefault()