Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Luis Fernando Molina committed 2019-07-28 22:48:28 +02:00
commit 335fd88d3c
7 files changed
+42 -164

No files matched your search

+10 -2
View File
@@ -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'
+3
View File
@@ -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]
+23 -50
View File
@@ -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)
<br/><br/>
@@ -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,81 +237,51 @@ 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):**
**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
**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.
## Maintainer
+3 -1
View File
@@ -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) {
+1 -2
View File
@@ -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 */
+2 -2
View File
@@ -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'
-107
View File
@@ -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 (
<div> TESTING CANVAS APP </div>
// <BannerTopBar
// size='medium'
// title=''
// text='Charts loading...'
// backgroundUrl='https://superalgos.org/img/photos/superalgos-platform.jpg'
// />
)
}
}
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))