From f0ce1abcdb57b7339c7b6e5e48a8d3c3c7e6356d Mon Sep 17 00:00:00 2001 From: Julian Molina Date: Sat, 13 Jul 2019 22:15:26 +0200 Subject: [PATCH 1/9] Update README.md --- README.md | 59 +++++++++++++++++++++---------------------------------- 1 file changed, 22 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 21ad13fcd..eddff03f9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The Canvas App provides a visual environment for the _Charting System_ and the _ # Trading System Automation Demo -Use the latest Chrome version to [access the Demo](https://demo.superalgos.org), sign up, log in and click on the CHARTS link in the Menu. +Use the latest Chrome version to access the Demo (to become available soon), sign up, log in and click on the CHARTS link in the Menu. ![Access-Demo](https://user-images.githubusercontent.com/13994516/58415158-dbe50f00-807d-11e9-812c-3b4de503bc34.gif)

@@ -198,7 +198,10 @@ In the example above, conditions A and B are mathematical comparison statements **candle.close:** The latest price of the current candle. -**candle.direction:** Down: candle.close > candle.open | Up: candle.close < candle.open | Side: candle.close = candle.open +**candle.direction:** +* Down: candle.close > candle.open +* Up: candle.close < candle.open +* Side: candle.close = candle.open **candle.previous:** Refers to the previous candle. You may use _candle.previous_ to fetch any of the variables of the previous candle (i.e.: _candle.previous.close_). You may also use as many _.previous_ as required to fetch values of more than one period behind the current one (i.e.: _candle.previous.previous.max_ returns the maximum value of two candles before the current one). @@ -234,30 +237,12 @@ In the example above, conditions A and B are mathematical comparison statements ### Bollinger Channels -**bollingerChannel.begin:** - -**bollingerChannel.end:** - **bollingerChannel.direction (Down | Up | Side):** -**bollingerChannel.period:** - -**bollingerChannel.firstMovingAverage:** - -**bollingerChannel.lastMovingAverage:** - -**bollingerChannel.firstDeviation:** - -**bollingerChannel.lastDeviation:** - -**bollingerChannel.previous:** +**bollingerChannel.period:** The number of periods the channel spans at the moment the variable is being read. For instance, if a channel spans 10 candles and the variable is checked on the fourth candle, then _bollingerChannel.period_ = 4. Put in other words, it is the current span of the channel. ### Bollinger SubChannels -**bollingerSubChannel.begin:** - -**bollingerSubChannel.end:** - **bollingerSubChannel.direction (Down | Up | Side):** **bollingerSubChannel.slope (Steep | Medium | Gentle | Side):** @@ -278,36 +263,36 @@ In the example above, conditions A and B are mathematical comparison statements **strategyStage (No Stage | Trigger Stage | Open Stage | Manage Stage | Close Stage):** -**stopLoss:** +**stopLoss:** The value of your Stop in the active phase. -**stopLossPhase (0 | 1 | ...):** +**stopLossPhase (0 | 1 | ...):** The number of the active Stop phase. -**takeProfit:** +**takeProfit:** The value of the Take Profit in the active phase. -**takeProfitPhase:** +**takeProfitPhase:** The number of the active Stop phase. -**positionRate:** +**positionRate:** The price at which the position was taken. -**positionSize:** +**positionSize:** The size of the position. -**positionInstant:** +**positionInstant:** The datetime in which the position was taken. -**balanceAssetA:** +**balanceAssetA:** The balance of your _base asset_. -**balanceAssetB:** +**balanceAssetB:** The balance of the second asset. -**lastTradeProfitLoss:** +**lastTradeProfitLoss:** The P&L value for the latest completed trade (roundtrip). -**lastTradeROI:** +**lastTradeROI:** The ROI of your latest trade. -**profit:** +**profit:** The total P&L during the current execution period. -**roundtrips:** +**roundtrips:** The total number of trades in the current execution. -**fails:** +**fails:** The number of trades resulting in losses in the current execution. -**hits:** +**hits:** The number of trades resulting in profits in the current execution. -**periods:** +**periods:** The number of candles evaluated in the current execution. From 77fac25412e5d220852a2cee7c39f46f8de41773 Mon Sep 17 00:00:00 2001 From: Matias Date: Wed, 17 Jul 2019 08:30:41 -0300 Subject: [PATCH 2/9] Fixing bot name issue --- StrategySpace/StrategizerGateway.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/StrategySpace/StrategizerGateway.js b/StrategySpace/StrategizerGateway.js index 96c28b5b0..589ff517e 100644 --- a/StrategySpace/StrategizerGateway.js +++ b/StrategySpace/StrategizerGateway.js @@ -46,7 +46,7 @@ function newStrategizerGateway () { } user = JSON.parse(user) - let fbSlug = 'simulator' + '-' + user.alias.replace('.', '') + let fbSlug = 'simulator-bot-' + user.alias.replace('.', '') graphQLServer = await axios({ url: window.canvasApp.graphQL.masterAppApiUrl, @@ -101,7 +101,6 @@ function newStrategizerGateway () { } user = JSON.parse(user) - let fbSlug = 'simulator' + '-' + user.alias.replace('.', '') /* See if we need to update or create a new record at the strategizer */ From e18a6f398f3a610f3dd2c2963f9e7bf9de7fe5df Mon Sep 17 00:00:00 2001 From: Matias Date: Wed, 17 Jul 2019 08:30:41 -0300 Subject: [PATCH 3/9] Fixing bot name issue --- StrategySpace/StrategizerGateway.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/StrategySpace/StrategizerGateway.js b/StrategySpace/StrategizerGateway.js index 96c28b5b0..589ff517e 100644 --- a/StrategySpace/StrategizerGateway.js +++ b/StrategySpace/StrategizerGateway.js @@ -46,7 +46,7 @@ function newStrategizerGateway () { } user = JSON.parse(user) - let fbSlug = 'simulator' + '-' + user.alias.replace('.', '') + let fbSlug = 'simulator-bot-' + user.alias.replace('.', '') graphQLServer = await axios({ url: window.canvasApp.graphQL.masterAppApiUrl, @@ -101,7 +101,6 @@ function newStrategizerGateway () { } user = JSON.parse(user) - let fbSlug = 'simulator' + '-' + user.alias.replace('.', '') /* See if we need to update or create a new record at the strategizer */ From 642ef87f5ad26b391659a4e2c782d770e2331cfc Mon Sep 17 00:00:00 2001 From: Matias Date: Wed, 17 Jul 2019 10:01:03 -0300 Subject: [PATCH 4/9] Disabling workspace on local storage --- StrategySpace/Workspace/Workspace.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/StrategySpace/Workspace/Workspace.js b/StrategySpace/Workspace/Workspace.js index 661f96ce0..8ee674b5e 100644 --- a/StrategySpace/Workspace/Workspace.js +++ b/StrategySpace/Workspace/Workspace.js @@ -59,8 +59,8 @@ function newWorkspace () { } user = JSON.parse(user) - let idAtStrategizer = window.localStorage.getItem(CANVAS_APP_NAME + '.' + 'Strategizer Gateway' + '.' + user.alias) - let savedWorkspace = window.localStorage.getItem(CANVAS_APP_NAME + '.' + 'Workspace' + '.' + user.alias) + let idAtStrategizer = null + let savedWorkspace = null if (savedWorkspace === null || idAtStrategizer === null) { workspaceNode.type = 'Workspace' From c8ef3e9b73162d223586d1d1297c21d4526eda52 Mon Sep 17 00:00:00 2001 From: Julian Molina Date: Wed, 17 Jul 2019 19:08:23 +0200 Subject: [PATCH 5/9] Update README.md --- README.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/README.md b/README.md index eddff03f9..181a3e267 100644 --- a/README.md +++ b/README.md @@ -245,19 +245,7 @@ In the example above, conditions A and B are mathematical comparison statements **bollingerSubChannel.direction (Down | Up | Side):** -**bollingerSubChannel.slope (Steep | Medium | Gentle | Side):** - -**bollingerSubChannel.period:** - -**bollingerSubChannel.firstMovingAverage:** - -**bollingerSubChannel.lastMovingAverage:** - -**bollingerSubChannel.firstDeviation:** - -**bollingerSubChannel.lastDeviation:** - -**bollingerSubChannel.previous:** +**bollingerSubChannel.period:** The number of periods the subchannel spans at the moment the variable is being read. For instance, if a subchannel spans 10 candles and the variable is checked on the fourth candle, then _bollingerChannel.period_ = 4. Put in other words, it is the current span of the subchannel. ### Internal From 21c04b9e7c72647164acbd1103be12e2986124ae Mon Sep 17 00:00:00 2001 From: Matias Date: Sat, 27 Jul 2019 07:33:21 -0300 Subject: [PATCH 6/9] unused file --- index.js | 107 ------------------------------------------------------- 1 file changed, 107 deletions(-) delete mode 100644 index.js diff --git a/index.js b/index.js deleted file mode 100644 index 55351f6b8..000000000 --- a/index.js +++ /dev/null @@ -1,107 +0,0 @@ -import React, { Component } from 'react' - -import { withStyles } from '@material-ui/core/styles' -import { connect } from 'react-redux' -// import { BannerTopBar } from '../common' -import { loadAdvancedAlgosPlatform } from './Scripts/AppPreLoader' - -const styles = theme => ({ - '@global': { - body: { - backgroundColor: theme.palette.common.white - } - }, - layout: { - width: '100%', - height: '100%' - }, - heroContent: { - textColor: theme.palette.common.white, - maxWidth: 600, - height: 800, - margin: '0 auto', - padding: `${theme.spacing.unit * 8}px 0 ${theme.spacing.unit * 6}px` - } -}) - -class Charts extends Component { - componentDidMount () { - console.log("componentDidMount") - // if (window.canvasApp.visible === undefined) { - loadCanvas() // This happens only once. - // } - - // window.canvasApp.visible = true - let body = document.getElementById('body') - body.style = 'margin: 0px; padding: 0px; border: 0px; overflow:hidden;' - this.props.hideFooter() - } - - componentWillUnmount () { - // window.canvasApp.visible = false - let body = document.getElementById('body') - body.style = '' - this.props.showFooter() - } - - render () { - return ( -
TESTING CANVAS APP
- // - ) - } -} - -function loadCanvas(){ - console.log("loadCanvas") - // if (window.canvasApp.visible === undefined) { - window.canvasApp = { - version: '1.0.0', // This is used to avoid catching problems at the browser level. - sessionToken: '', - executingAt: 'Master App', - visible: false, - topMargin: 130, - urlPrefix:'http://localhost:3100/', - // urlPrefix: '<%= process.env.CANVAS_URL %>', - graphQL: { - masterAppApiUrl: '<%= process.env.PLATFORM_API_URL %>', - }, - context: {} - }; - - try { - loadAdvancedAlgosPlatform(); - } - catch (err) { - console.log("[ERROR] MasterApp -> Index -> CanvasApp can not be started. Please check that AAWeb is running."); - console.log("[ERROR] MasterApp -> Index -> err = " + err.stack); - } - // } -} - -const mapStateToProps = state => { - return { - context: state.context - } -} - -const mapDispatchToProps = dispatch => { - return { - hideFooter: () => { - dispatch({ type: 'HIDE_FOOTER' }) - }, - showFooter: () => { - dispatch({ type: 'SHOW_FOOTER' }) - } - } -} - -export default connect( - mapStateToProps, - mapDispatchToProps -)(withStyles(styles)(Charts)) From 5c32940f02dd78222414c1b3c993d33933c2d1cc Mon Sep 17 00:00:00 2001 From: Matias Date: Sat, 27 Jul 2019 07:33:32 -0300 Subject: [PATCH 7/9] alternative to get ecosystem from file --- Panels/ProductsPanel.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Panels/ProductsPanel.js b/Panels/ProductsPanel.js index 01cf93ce4..958183d4c 100644 --- a/Panels/ProductsPanel.js +++ b/Panels/ProductsPanel.js @@ -61,6 +61,9 @@ function newProductsPanel () { /* First thing is to build the thisObject.productCards array */ let ecosystem = JSON.parse(window.localStorage.getItem('ecosystem')) + if (ecosystem === null || ecosystem === undefined) { + ecosystem = getUserEcosystem() + } for (let i = 0; i < ecosystem.devTeams.length; i++) { let devTeam = ecosystem.devTeams[i] From c05e307fef8551bf0e50041fc425f7e528b9b050 Mon Sep 17 00:00:00 2001 From: Matias Date: Sat, 27 Jul 2019 09:14:36 -0300 Subject: [PATCH 8/9] Fixing viewport issue --- Spaces/TopSpace.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Spaces/TopSpace.js b/Spaces/TopSpace.js index 9bb7e57b8..c67effb91 100644 --- a/Spaces/TopSpace.js +++ b/Spaces/TopSpace.js @@ -41,7 +41,9 @@ function newTopSpace () { thisObject.container.frame.height = TOP_SPACE_HEIGHT container.frame.position.x = 0 - container.frame.position.y = viewPort.visibleArea.bottomLeft.y + try { + container.frame.position.y = viewPort.visibleArea.bottomLeft.y + } catch(e) { } } function getContainer (point) { From 8259b2325aa6deec875eeee680f51f5d09694f73 Mon Sep 17 00:00:00 2001 From: Matias Date: Sat, 27 Jul 2019 10:08:21 -0300 Subject: [PATCH 9/9] Fixing viewport issue --- Dashboard.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Dashboard.js b/Dashboard.js index 94896fc5c..4e69b50cb 100644 --- a/Dashboard.js +++ b/Dashboard.js @@ -1,8 +1,16 @@ -  let canvas let markets let ecosystem = newEcosystem() -let viewPort = newViewPort() + +let viewPort +try { + viewPort = newViewPort() +} catch (e) { + setTimeout(() => { + console.log("Loading deferred.") + viewPort = newViewPort() + }, 1000); +} function newDashboard () { const MODULE_NAME = 'Dashboard'