Bug fixes and little improvements
This commit is contained in:
1 parent
fe06c50b9c
commit
b31c6da561
7 files changed
+60
-32
No files matched your search
@@ -68,7 +68,6 @@ function newWorkspace () {
|
||||
let droppedNode
|
||||
let sessionTimestamp = (new Date()).valueOf()
|
||||
window.localStorage.setItem('Session Timestamp', sessionTimestamp)
|
||||
console.log(sessionTimestamp)
|
||||
|
||||
return thisObject
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ function newLayersPanel () {
|
||||
}
|
||||
|
||||
function panelSizePhysics () {
|
||||
if (isInitialized === false || thisObject.visible === false || thisObject.isHidden === true) { return }
|
||||
if (isInitialized === false || thisObject.isHidden === true) { return }
|
||||
|
||||
let viewPortHeight = canvas.chartingSpace.viewport.visibleArea.bottomLeft.y - canvas.chartingSpace.viewport.visibleArea.topLeft.y
|
||||
|
||||
@@ -237,6 +237,8 @@ function newLayersPanel () {
|
||||
thisObject.visible = true
|
||||
}
|
||||
|
||||
if (thisObject.visible === false) { return }
|
||||
|
||||
if (desiredPanelHeight > viewPortHeight) {
|
||||
posibleVisibleLayers = Math.trunc((viewPortHeight - headerHeight - footerHeight) / (layerHeight + LAYER_SEPARATION))
|
||||
} else {
|
||||
|
||||
@@ -96,7 +96,8 @@ function newPlotterPanel () {
|
||||
|
||||
const X_AXIS = thisObject.container.frame.width / 2
|
||||
const Y_AXIS = frameTitleHeight + frameBodyHeight / 2
|
||||
const PANEL_HEIGHT = frameTitleHeight + frameBodyHeight
|
||||
|
||||
const PANEL_HEIGHT = UI_PANEL.HEIGHT.NORMAL
|
||||
|
||||
if (currentRecord === undefined) { return }
|
||||
if (currentRecord.data === undefined) { return }
|
||||
@@ -113,7 +114,7 @@ function newPlotterPanel () {
|
||||
}
|
||||
}
|
||||
|
||||
printLabel('Indicator Properties', X_AXIS, PANEL_HEIGHT * 17 / 100 / 1.25, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction)
|
||||
printLabel('Indicator Properties', X_AXIS, UI_PANEL.HEIGHT.NORMAL * 17 / 100, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction)
|
||||
|
||||
/* Second we go through the panel data. */
|
||||
if (panelNode.panelData === undefined) { return }
|
||||
@@ -126,8 +127,19 @@ function newPlotterPanel () {
|
||||
let value = 'No value defined.'
|
||||
|
||||
if (valuePosition > 100) {
|
||||
heightFactor = 1.25
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * heightFactor
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 1.25
|
||||
}
|
||||
|
||||
if (valuePosition > 125) {
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 1.50
|
||||
}
|
||||
|
||||
if (valuePosition > 150) {
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 1.75
|
||||
}
|
||||
|
||||
if (valuePosition > 175) {
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 2.00
|
||||
}
|
||||
|
||||
if (panelData.dataFormula !== undefined) {
|
||||
@@ -140,7 +152,11 @@ function newPlotterPanel () {
|
||||
}
|
||||
|
||||
if (panelData.code.valueDecimals !== undefined) {
|
||||
value = value.toFixed(panelData.code.valueDecimals)
|
||||
if (value !== undefined) {
|
||||
if (isNaN(value) === false) {
|
||||
value = value.toFixed(panelData.code.valueDecimals)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (panelData.code.labelText !== undefined) {
|
||||
@@ -155,8 +171,8 @@ function newPlotterPanel () {
|
||||
valuePosition = panelData.code.valuePosition
|
||||
}
|
||||
|
||||
printLabel(labelText, X_AXIS, PANEL_HEIGHT * labelPosition / 100 / heightFactor, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction)
|
||||
printLabel(value, X_AXIS, PANEL_HEIGHT * valuePosition / 100 / heightFactor, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction)
|
||||
printLabel(labelText, X_AXIS, UI_PANEL.HEIGHT.NORMAL * labelPosition / 100 / heightFactor, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction)
|
||||
printLabel(value, X_AXIS, UI_PANEL.HEIGHT.NORMAL * valuePosition / 100 / heightFactor, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -331,6 +331,7 @@
|
||||
let currentDate = new Date(farLeftDate.valueOf());
|
||||
|
||||
bands = [];
|
||||
let lastBand
|
||||
|
||||
while (currentDate.valueOf() <= farRightDate.valueOf() + ONE_DAY_IN_MILISECONDS) {
|
||||
|
||||
@@ -356,6 +357,14 @@
|
||||
band.standardDeviation = dailyFile[i][3];
|
||||
band.deviation = dailyFile[i][4];
|
||||
|
||||
if (lastBand !== undefined) {
|
||||
if (lastBand.movingAverage > band.movingAverage) { band.direction = "Down" }
|
||||
if (lastBand.movingAverage < band.movingAverage) { band.direction = "Up" }
|
||||
if (lastBand.movingAverage === band.movingAverage) { band.direction = "Side" }
|
||||
}
|
||||
|
||||
lastBand = band
|
||||
|
||||
if (
|
||||
(band.begin >= farLeftDate.valueOf() && band.end <= farRightDate.valueOf()) &&
|
||||
(band.begin >= coordinateSystem.min.x && band.end <= coordinateSystem.max.x)
|
||||
@@ -386,13 +395,9 @@
|
||||
if (bands[0].begin > lowerEnd || bands[bands.length - 1].end < upperEnd) {
|
||||
|
||||
setTimeout(recalculate, 2000);
|
||||
|
||||
//console.log("File missing while calculating bands, scheduling a recalculation in 2 seconds.");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//console.log("Olivia > recalculateUsingDailyFiles > total bands generated : " + bands.length);
|
||||
|
||||
} catch (err) {
|
||||
|
||||
@@ -417,6 +422,7 @@
|
||||
rightDate = new Date(rightDate.valueOf() + dateDiff * 1.5);
|
||||
|
||||
bands = [];
|
||||
let lastBand
|
||||
|
||||
for (let i = 0; i < marketFile.length; i++) {
|
||||
|
||||
@@ -434,6 +440,14 @@
|
||||
band.standardDeviation = marketFile[i][3];
|
||||
band.deviation = marketFile[i][4];
|
||||
|
||||
if (lastBand !== undefined) {
|
||||
if (lastBand.movingAverage > band.movingAverage) { band.direction = "Down" }
|
||||
if (lastBand.movingAverage < band.movingAverage) { band.direction = "Up" }
|
||||
if (lastBand.movingAverage === band.movingAverage) { band.direction = "Side" }
|
||||
}
|
||||
|
||||
lastBand = band
|
||||
|
||||
if (
|
||||
(band.begin >= leftDate.valueOf() && band.end <= rightDate.valueOf()) &&
|
||||
(band.begin >= coordinateSystem.min.x && band.end <= coordinateSystem.max.x)
|
||||
|
||||
@@ -120,8 +120,8 @@ function newMastersPlottersBollingerBandsBollingerBandsBollingerBandsPanel () {
|
||||
|
||||
/* Extra bounderies due to constrained space */
|
||||
|
||||
const upperLimit = frameTitleHeight + frameBodyHeight * 0.15;
|
||||
const downLimit = frameTitleHeight + frameBodyHeight * 0.85;
|
||||
const upperLimit = frameTitleHeight + frameBodyHeight * 0.25;
|
||||
const downLimit = frameTitleHeight + frameBodyHeight * 0.75;
|
||||
|
||||
if (bandPoint1.y > downLimit) { bandPoint1.y = downLimit; }
|
||||
if (bandPoint4.y > downLimit) { bandPoint4.y = downLimit; }
|
||||
@@ -201,11 +201,20 @@ function newMastersPlottersBollingerBandsBollingerBandsBollingerBandsPanel () {
|
||||
|
||||
let y;
|
||||
|
||||
printLabel('Moving Average', X_AXIS, frameTitleHeight + frameBodyHeight * 0.05, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentBand.innerBand.movingAverage, X_AXIS, frameTitleHeight + frameBodyHeight * 0.10, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
printLabel('Deviation', X_AXIS, frameTitleHeight + frameBodyHeight * 0.95, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentBand.innerBand.deviation, X_AXIS, frameTitleHeight + frameBodyHeight * 0.90, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
if (currentBand.innerBand.direction !== undefined) {
|
||||
printLabel('Direction', X_AXIS, frameTitleHeight + frameBodyHeight * 0.05, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentBand.innerBand.direction, X_AXIS, frameTitleHeight + frameBodyHeight * 0.10, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
}
|
||||
|
||||
printLabel('Moving Average', X_AXIS, frameTitleHeight + frameBodyHeight * 0.15, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentBand.innerBand.movingAverage, X_AXIS, frameTitleHeight + frameBodyHeight * 0.20, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
printLabel('Deviation', X_AXIS, frameTitleHeight + frameBodyHeight * 0.85, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentBand.innerBand.deviation, X_AXIS, frameTitleHeight + frameBodyHeight * 0.80, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
printLabel('Standard Deviation', X_AXIS, frameTitleHeight + frameBodyHeight * 0.95, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentBand.innerBand.standardDeviation, X_AXIS, frameTitleHeight + frameBodyHeight * 0.90, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,21 +14,9 @@
|
||||
|
||||
let utilities = UTILITIES.newCloudUtilities(bot, logger);
|
||||
|
||||
let percentageBandwidthAt = {}
|
||||
let bollingerBandsAt = {}
|
||||
let bollingerChannelsAt = {}
|
||||
let bollingerSubChannelsAt = {}
|
||||
let candlesAt = {}
|
||||
|
||||
|
||||
return thisObject;
|
||||
|
||||
function finalize() {
|
||||
percentageBandwidthAt = undefined
|
||||
bollingerBandsAt = undefined
|
||||
bollingerChannelsAt = undefined
|
||||
bollingerSubChannelsAt = undefined
|
||||
candlesAt = undefined
|
||||
thisObject = undefined
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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","exchangeDataProducts":[{"type":"Exchange Data Products","name":"Binance","singleMarketData":[{"type":"Single Market Data","name":"Binance BTC/USDT","dataProducts":[{"type":"Data Product","name":"Candles","id":"884a5d08-b607-4b2b-8e7a-8adeb7e8dd4a","savedPayload":{"position":{"x":40547.50864374642,"y":29458.159568577485},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Candles","id":"fe6065ec-4d2d-47a0-bae0-8647f0e195d7"}}},{"type":"Data Product","name":"Volumes","id":"4ec71a01-3d83-4e8e-9780-bcb700dcf66a","savedPayload":{"position":{"x":40421.73265277628,"y":29446.388474093364},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Volumes","id":"1a366aef-efef-470e-88e0-2a6fbe4dd91f"}}},{"type":"Data Product","name":"Candle-Stairs","id":"5979844b-35e7-4c04-938f-18e6156352a0","savedPayload":{"position":{"x":40301.14133183628,"y":29408.85317326678},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Candle-Stairs","id":"642474e9-da61-4168-97dc-7f7869bebc02"}}},{"type":"Data Product","name":"Volume-Stairs","id":"dd1f89bc-3c2f-4fc4-a5f1-de7a34e0997e","savedPayload":{"position":{"x":40187.396275814746,"y":29353.016112581576},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Volume-Stairs","id":"846e9572-c4d6-4c7e-942e-c82402c5ecea"}}},{"type":"Data Product","name":"Bollinger Bands","id":"68df01d8-d9a8-400c-aa76-8da44c5dc040","savedPayload":{"position":{"x":40096.481080845784,"y":29265.09743042856},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Bands","id":"29088877-8d63-4217-8d34-8742afc262f4"}}},{"type":"Data Product","name":"Percentage Bandwidth","id":"9b5b1b81-c68c-45a5-8123-1a114a24b744","savedPayload":{"position":{"x":40012.72356856686,"y":29171.40183064097},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Percentage Bandwidth","id":"3b7885a0-cd72-4a3f-a38b-3dc8c47bd068"}}},{"type":"Data Product","name":"Bollinger Channels Objects","id":"632f0f98-eb2c-4820-9943-662a4903be81","savedPayload":{"position":{"x":39948.363007140084,"y":29062.244116046924},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Channels Objects","id":"1f111f72-624f-4166-9f99-ab8d785d5267"}}},{"type":"Data Product","name":"Bollinger Sub-Channels Objects","id":"88a1ca81-b317-4ab2-b651-c8fa566e8e28","savedPayload":{"position":{"x":39912.69159220981,"y":28940.34283010204},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Sub-Channels Objects","id":"080c87fc-4546-4482-ab11-180a33f6d9ab"}}},{"type":"Data Product","name":"Popular SMAs","id":"5bce195f-7d08-4281-bb9d-ca1e9417068e","savedPayload":{"position":{"x":39896.003039224,"y":28814.06986752792},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Popular SMAs","id":"4029d5bf-a8ad-4d80-b874-2af506e0ab34"}}},{"type":"Data Product","name":"Base7 SMAs","id":"b9145946-1899-4fac-b531-47ed600873be","savedPaylLine 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","exchangeDataProducts":[{"type":"Exchange Data Products","name":"Binance","singleMarketData":[{"type":"Single Market Data","name":"Binance BTC/USDT","dataProducts":[{"type":"Data Product","name":"Candles","id":"884a5d08-b607-4b2b-8e7a-8adeb7e8dd4a","savedPayload":{"position":{"x":40547.50864374642,"y":29458.159568577485},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Candles","id":"fe6065ec-4d2d-47a0-bae0-8647f0e195d7"}}},{"type":"Data Product","name":"Volumes","id":"4ec71a01-3d83-4e8e-9780-bcb700dcf66a","savedPayload":{"position":{"x":40421.73265277628,"y":29446.388474093364},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Volumes","id":"1a366aef-efef-470e-88e0-2a6fbe4dd91f"}}},{"type":"Data Product","name":"Candle-Stairs","id":"5979844b-35e7-4c04-938f-18e6156352a0","savedPayload":{"position":{"x":40301.14133183628,"y":29408.85317326678},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Candle-Stairs","id":"642474e9-da61-4168-97dc-7f7869bebc02"}}},{"type":"Data Product","name":"Volume-Stairs","id":"dd1f89bc-3c2f-4fc4-a5f1-de7a34e0997e","savedPayload":{"position":{"x":40187.396275814746,"y":29353.016112581576},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Volume-Stairs","id":"846e9572-c4d6-4c7e-942e-c82402c5ecea"}}},{"type":"Data Product","name":"Bollinger Bands","id":"68df01d8-d9a8-400c-aa76-8da44c5dc040","savedPayload":{"position":{"x":40096.481080845784,"y":29265.09743042856},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Bands","id":"29088877-8d63-4217-8d34-8742afc262f4"}}},{"type":"Data Product","name":"Percentage Bandwidth","id":"9b5b1b81-c68c-45a5-8123-1a114a24b744","savedPayload":{"position":{"x":40012.72356856686,"y":29171.40183064097},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Percentage Bandwidth","id":"3b7885a0-cd72-4a3f-a38b-3dc8c47bd068"}}},{"type":"Data Product","name":"Bollinger Channels Objects","id":"632f0f98-eb2c-4820-9943-662a4903be81","savedPayload":{"position":{"x":39948.363007140084,"y":29062.244116046924},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Channels Objects","id":"1f111f72-624f-4166-9f99-ab8d785d5267"}}},{"type":"Data Product","name":"Bollinger Sub-Channels Objects","id":"88a1ca81-b317-4ab2-b651-c8fa566e8e28","savedPayload":{"position":{"x":39912.69159220981,"y":28940.34283010204},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":true,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Bollinger Sub-Channels Objects","id":"080c87fc-4546-4482-ab11-180a33f6d9ab"}}},{"type":"Data Product","name":"Popular SMAs","id":"5bce195f-7d08-4281-bb9d-ca1e9417068e","savedPayload":{"position":{"x":39896.003039224,"y":28814.06986752792},"targetPosition":{"x":40547.50864374642,"y":28814.06986752792},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3},"uiObject":{"isRunning":false},"referenceParent":{"type":"Product Definition","name":"Popular SMAs","id":"4029d5bf-a8ad-4d80-b874-2af506e0ab34"}}},{"type":"Data Product","name":"Base7 SMAs","id":"b9145946-1899-4fac-b531-47ed600873be","savedPaylLine truncated
|
||||
Reference in new issue
Block a user