Merge pull request #159 from Superalgos/develop

Develop
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2020-03-01 11:21:21 +01:00
commit 202171defe
7 files changed
+45 -14

No files matched your search

+3 -1
View File
@@ -578,7 +578,9 @@ function newCanvas () {
return
} else {
if (container.isClickeable === false) {
viewPortBeingDragged = true
if (event.buttons === 2) {
viewPortBeingDragged = true
}
}
return
}
+10 -7
View File
@@ -77,17 +77,20 @@ function newEdgeEditor () {
switch (event.buttons) {
case 1: {
buttonUsedForDragging = 'left mouse button'
if (event.shiftKey === true) {
buttonUsedForDragging = 'left mouse button + SHIFT'
}
break
}
case 2: {
buttonUsedForDragging = 'right mouse button'
buttonUsedForDragging = 'right mouse button' // this will never happen as of today
break
}
}
}
function getContainer (event, purpose) {
if (thisObject.container.frame.isThisPointHere(event, undefined, undefined, -EDGE_SIZE) === true && event.shiftKey !== true) {
if (thisObject.container.frame.isThisPointHere(event, undefined, undefined, -EDGE_SIZE) === true && event.buttons !== 2) {
let point = {
x: event.x,
y: event.y
@@ -143,7 +146,7 @@ function newEdgeEditor () {
switch (whereIsMouseOver) {
case 'center': {
switch (buttonUsedForDragging) {
case 'right mouse button': {
case 'left mouse button + SHIFT': {
/* This is equivalent to drag the whole Time Machine, so we will apply the translation received onto the Time Machine container. */
thisObject.container.parentContainer.frame.position.x = thisObject.container.parentContainer.frame.position.x + dragVector.x
thisObject.container.parentContainer.frame.position.y = thisObject.container.parentContainer.frame.position.y + dragVector.y
@@ -198,7 +201,7 @@ function newEdgeEditor () {
coordinateSystem.recalculateScale(event)
break
}
case 'right mouse button': {
case 'left mouse button + SHIFT': {
coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
coordinateSystem.recalculateScale()
break
@@ -231,7 +234,7 @@ function newEdgeEditor () {
coordinateSystem.recalculateScale(event)
break
}
case 'right mouse button': {
case 'left mouse button + SHIFT': {
coordinateSystem.maxHeight = thisObject.container.parentContainer.frame.height
coordinateSystem.recalculateScale()
break
@@ -260,7 +263,7 @@ function newEdgeEditor () {
coordinateSystem.recalculateScale()
break
}
case 'right mouse button': {
case 'left mouse button + SHIFT': {
coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
coordinateSystem.recalculateScale()
break
@@ -289,7 +292,7 @@ function newEdgeEditor () {
coordinateSystem.recalculateScale()
break
}
case 'right mouse button': {
case 'left mouse button + SHIFT': {
coordinateSystem.maxWidth = thisObject.container.parentContainer.frame.width
coordinateSystem.recalculateScale()
break
+1 -1
View File
@@ -394,7 +394,7 @@ function newTimeMachine () {
}
function panelPhysics () {
if (thisObject.container.frame.isInViewPort() && canvas.chartingSpace.viewport.zoomTargetLevel > ZOOM_OUT_THRESHOLD_FOR_HIDDING_PANELS) {
if (thisObject.container.frame.isCenterInViewPort() && canvas.chartingSpace.viewport.zoomTargetLevel > ZOOM_OUT_THRESHOLD_FOR_HIDDING_PANELS) {
canvas.panelsSpace.unHide(thisObject.payload.node.id, 'Layers Panel')
canvas.panelsSpace.unHide(thisObject.payload.node.id, 'Plotter Panel')
} else {
+26
View File
@@ -21,6 +21,7 @@ function newFrame () {
isThisPointHere: isThisPointHere, // This function return true is the point received as parameter lives within this frame.
isThisScreenPointHere: isThisScreenPointHere,
isInViewPort: isInViewPort,
isCenterInViewPort: isCenterInViewPort,
initialize: initialize,
finalize: finalize
}
@@ -76,6 +77,31 @@ function newFrame () {
}
}
function isCenterInViewPort () {
/* This function is usefull to know if the object who has this frame is currently appearing at least in part at the canvas.chartingSpace.viewport */
point1 = {
x: thisObject.width * 25 / 100,
y: thisObject.height * 25 / 100
}
point3 = {
x: thisObject.width * 75 / 100,
y: thisObject.height * 75 / 100
}
/* Now the transformations. */
point1 = transformThisPoint(point1, thisObject.container)
point3 = transformThisPoint(point3, thisObject.container)
if (point1.x < canvas.chartingSpace.viewport.visibleArea.topRight.x && point1.y < canvas.chartingSpace.viewport.visibleArea.bottomRight.y && point3.x > canvas.chartingSpace.viewport.visibleArea.bottomLeft.x && point3.y > canvas.chartingSpace.viewport.visibleArea.topLeft.y) {
return true
} else {
return false
}
}
function frameThisPoint (point) {
/* We need not to modify the point received, so me make a copy of it. */
+2 -2
View File
@@ -347,7 +347,7 @@ function newPanelsSpace () {
return container
}
}
thisObject.container.space = 'Panels Space'
return thisObject.container
// thisObject.container.space = 'Panels Space'
// return thisObject.container
}
}
+2 -2
View File
@@ -10,8 +10,8 @@ The current version opens up the door to working with multiple exchanges and mul
| Exchange | Historic Trades Capability [*] | Trading Capability [**] | Comments |
| :--- | :---: | :---: | :---: |
| Binance | &#x2611; | &#x2611; | You will need an Exchange Key to download Hitoric Trades. |
| Bitfinex | &#x2611; | &#x2611; | Fully tested. Expect 1 year max of Historic Trades. |
| Binance | &#x2611; | &#x2611; | Fully tested. Market history from Sep 2017. |
| Bitfinex | &#x2611; | &#x2611; | Fully tested. Expect 1 year max of market history. |
| Bitmex | &#x2611; | &#x2610; | We need to implement the concept of Contracts within the system in order to be able to test trading capabilities. |
| HitBTC | &#x2610; | &#x2610; | Not tested yet. |
| Kraken | &#x2611; | &#x2610; | Live trading not tested yet. |
+1 -1
View File
@@ -1 +1 @@
{"type":"Workspace","name":"My Workspace","rootNodes":[{"type":"Network","name":"Superalgos","networkNodes":[{"type":"Network Node","name":"My Computer","dataStorage":{"type":"Data Storage","name":"New Data Storage","sessionIndependentData":{"type":"Session Independent Data","name":"New Session Independent Data","singleMarketData":[{"type":"Single Market Data","name":"Bitfinex BTC/USDT","dataProducts":[{"type":"Data Product","name":"Candles","id":"e874f15d-d7ae-45ad-a2be-ce58b4ce3f74","savedPayload":{"position":{"x":25078.18370711238,"y":30761.029426004818},"targetPosition":{"x":24832.966854756884,"y":30359.485158506814},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Candles","id":"fe6065ec-4d2d-47a0-bae0-8647f0e195d7"}}},{"type":"Data Product","name":"Volumes","id":"9e19f9c2-20d0-45f5-8be3-07779955b095","savedPayload":{"position":{"x":25000.22485867673,"y":30799.250850170447},"targetPosition":{"x":24832.966854756884,"y":30359.485158506814},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Volumes","id":"1a366aef-efef-470e-88e0-2a6fbe4dd91f"}}},{"type":"Data Product","name":"Candle-Stairs","id":"fc072fa8-c6d9-4634-9fea-e034f8b803c1","savedPayload":{"position":{"x":24916.570239521454,"y":30822.496581147283},"targetPosition":{"x":24832.966854756884,"y":30359.485158506814},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Candle-Stairs","id":"642474e9-da61-4168-97dc-7f7869bebc02"}}},{"type":"Data Product","name":"Volume-Stairs","id":"b1b226f4-076f-4fe0-a816-26921bf3f307","savedPayload":{"position":{"x":24830.06860736923,"y":30829.975013447092},"targetPosition":{"x":24832.966854756884,"y":30359.485158506814},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Volume-Stairs","id":"846e9572-c4d6-4c7e-942e-c82402c5ecea"}}},{"type":"Data Product","name":"Bollinger Bands","id":"e27f6e00-07c7-4b3e-8009-6742f96ea525","savedPayload":{"position":{"x":24743.665671555726,"y":30821.431478027294},"targetPosition":{"x":24832.966854756884,"y":30359.485158506814},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Bollinger Bands","id":"29088877-8d63-4217-8d34-8742afc262f4"}}},{"type":"Data Product","name":"Percentage Bandwidth","id":"a670f312-7f89-488c-b1cd-12168f502de2","savedPayload":{"position":{"x":24660.30378043117,"y":30797.156914739768},"targetPosition":{"x":24832.966854756884,"y":30359.485158506814},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Percentage Bandwidth","id":"3b7885a0-cd72-4a3f-a38b-3dc8c47bd068"}}},{"type":"Data Product","name":"Bollinger Channels Objects","id":"b803c505-9d9c-44da-8b9f-c1a4fde5f12b","savedPayload":{"position":{"x":24582.82172321625,"y":30757.977964723144},"targetPosition":{"x":24832.966854756884,"y":30359.485158506814},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Bollinger Channels Objects","id":"1f111f72-624f-4166-9f99-ab8d785d5267"}}},{"type":"Data Product","name":"Bollinger Sub-Channels Objects","id":"f83b1c03-f44c-434e-aa10-8fd10223aa4a","savedPayload":{"position":{"x":24513.858058439928,"y":30705.22882013026},"targetPosition":{"x":24832.966854756884,"y":30359.485158506814},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Bollinger Sub-Channels Objects","id":"080c87fc-4546-4482-ab11-180a33f6d9ab"}}},{"type":"Data Product","name":"Popular SMAs","id":"b608edc8-e3ea-4fba-a0f0-59e57932297e","savedPayload":{"position":{"x":24455.761260993364,"y":30640.70578981461},"targetPosition":{"x":24832.966854756884,"y":30359.485158506814},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Popular SMAs","id":"4029d5bf-a8ad-4d80-b874-2af506e0ab34"}}},{"type":"Data Product","name":"Base7 SMAs","id":"e8903d94-681f-4518-8bce-b260d9b2921b","savedPayload":{"position":{"x":24410.50974763417,"y":30566.60612818674},"targetPosition":{"x":24832.966854756884,"y":30359.485158506814},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"aLine truncated
{"type":"Workspace","name":"My Workspace","rootNodes":[{"type":"Network","name":"Superalgos","networkNodes":[{"type":"Network Node","name":"My Computer","dataStorage":{"type":"Data Storage","name":"New Data Storage","sessionIndependentData":{"type":"Session Independent Data","name":"New Session Independent Data","singleMarketData":[{"type":"Single Market Data","name":"Binance BTC/USDT","dataProducts":[{"type":"Data Product","name":"Candles","id":"592901f9-9d7e-4d02-9c3e-9941fd1cbc62","savedPayload":{"position":{"x":25077.92118083212,"y":30760.520078448346},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Candles","id":"fe6065ec-4d2d-47a0-bae0-8647f0e195d7"}}},{"type":"Data Product","name":"Volumes","id":"54e5d587-dae5-4901-8625-899f3b6eb361","savedPayload":{"position":{"x":24999.96233239647,"y":30798.741502613975},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Volumes","id":"1a366aef-efef-470e-88e0-2a6fbe4dd91f"}}},{"type":"Data Product","name":"Candle-Stairs","id":"7f5856c1-cf3a-4525-8036-69da93e57771","savedPayload":{"position":{"x":24916.307713241193,"y":30821.98723359081},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Candle-Stairs","id":"642474e9-da61-4168-97dc-7f7869bebc02"}}},{"type":"Data Product","name":"Volume-Stairs","id":"fad346d0-20f9-4cf4-9663-7eb54622b5f0","savedPayload":{"position":{"x":24829.80608108897,"y":30829.46566589062},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Volume-Stairs","id":"846e9572-c4d6-4c7e-942e-c82402c5ecea"}}},{"type":"Data Product","name":"Bollinger Bands","id":"2fc1f392-7d9b-409e-9cb7-85c14e1e7c07","savedPayload":{"position":{"x":24743.403145275464,"y":30820.922130470823},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Bollinger Bands","id":"29088877-8d63-4217-8d34-8742afc262f4"}}},{"type":"Data Product","name":"Percentage Bandwidth","id":"e7c4252c-3b6b-4b21-9f7a-6a6263739835","savedPayload":{"position":{"x":24660.04125415091,"y":30796.647567183296},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Percentage Bandwidth","id":"3b7885a0-cd72-4a3f-a38b-3dc8c47bd068"}}},{"type":"Data Product","name":"Bollinger Channels Objects","id":"3e9c58db-ca68-4089-9a02-d99f01428a41","savedPayload":{"position":{"x":24582.55919693599,"y":30757.468617166673},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Bollinger Channels Objects","id":"1f111f72-624f-4166-9f99-ab8d785d5267"}}},{"type":"Data Product","name":"Bollinger Sub-Channels Objects","id":"b47bf5eb-2f3e-462f-aa45-8e5c6ae784bc","savedPayload":{"position":{"x":24513.595532159667,"y":30704.71947257379},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Bollinger Sub-Channels Objects","id":"080c87fc-4546-4482-ab11-180a33f6d9ab"}}},{"type":"Data Product","name":"Popular SMAs","id":"67a989ee-e8da-4079-9b0a-8a7509db45a5","savedPayload":{"position":{"x":24455.498734713103,"y":30640.196442258137},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{},"referenceParent":{"type":"Product Definition","name":"Popular SMAs","id":"4029d5bf-a8ad-4d80-b874-2af506e0ab34"}}},{"type":"Data Product","name":"Base7 SMAs","id":"763cde69-4a76-498f-a753-87baa3b227f3","savedPayload":{"position":{"x":24410.247221353908,"y":30566.09678063027},"targetPosition":{"x":24832.704328476622,"y":30358.975810950342},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"anLine truncated