Multi Project
This commit is contained in:
1 parent
3f71e7fcb6
commit
85b1d86493
561 files changed
+1215
-28069
No files matched your search
@@ -67,8 +67,8 @@
|
||||
|
||||
/* Stop listening to the necesary events. */
|
||||
thisObject.container.eventHandler.stopListening(onMouseOverEventSuscriptionId)
|
||||
canvas.chartingSpace.viewport.eventHandler.stopListening(zoomChangedEventSubscriptionId);
|
||||
canvas.chartingSpace.viewport.eventHandler.stopListening(offsetChangedEventSubscriptionId);
|
||||
UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.stopListening(zoomChangedEventSubscriptionId);
|
||||
UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.stopListening(offsetChangedEventSubscriptionId);
|
||||
canvas.eventHandler.stopListening(dragFinishedEventSubscriptionId);
|
||||
thisObject.container.eventHandler.stopListening(dimmensionsChangedEventSubscriptionId)
|
||||
marketFiles.eventHandler.stopListening(marketFilesUpdatedEventSubscriptionId);
|
||||
@@ -121,8 +121,8 @@
|
||||
|
||||
/* Listen to the necesary events. */
|
||||
|
||||
zoomChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent("Zoom Changed", onViewportZoomChanged);
|
||||
offsetChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent("Position Changed", onViewportPositionChanged);
|
||||
zoomChangedEventSubscriptionId = UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.listenToEvent("Zoom Changed", onViewportZoomChanged);
|
||||
offsetChangedEventSubscriptionId = UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.listenToEvent("Position Changed", onViewportPositionChanged);
|
||||
dragFinishedEventSubscriptionId = canvas.eventHandler.listenToEvent("Drag Finished", onDragFinished);
|
||||
marketFilesUpdatedEventSubscriptionId = marketFiles.eventHandler.listenToEvent("Files Updated", onMarketFilesUpdated);
|
||||
dailyFilesUpdatedEventSubscriptionId = dailyFiles.eventHandler.listenToEvent("Files Updated", onDailyFilesUpdated);
|
||||
@@ -157,7 +157,7 @@
|
||||
}
|
||||
|
||||
function onMouseOver(event) {
|
||||
let userPosition = getDateFromPointAtBrowserCanvas(event, thisObject.container, coordinateSystem)
|
||||
let userPosition = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(event, thisObject.container, coordinateSystem)
|
||||
userPositionDate = userPosition.valueOf()
|
||||
}
|
||||
|
||||
@@ -320,8 +320,8 @@
|
||||
|
||||
let daysOnSides = getSideDays(timeFrame);
|
||||
|
||||
let leftDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem);
|
||||
let rightDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem);
|
||||
let leftDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem);
|
||||
let rightDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem);
|
||||
|
||||
let dateDiff = rightDate.valueOf() - leftDate.valueOf();
|
||||
|
||||
@@ -413,8 +413,8 @@
|
||||
|
||||
let daysOnSides = getSideDays(timeFrame);
|
||||
|
||||
let leftDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem);
|
||||
let rightDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem);
|
||||
let leftDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem);
|
||||
let rightDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem);
|
||||
|
||||
let dateDiff = rightDate.valueOf() - leftDate.valueOf();
|
||||
|
||||
@@ -525,19 +525,19 @@
|
||||
bandPoint5 = coordinateSystem.transformThisPoint(bandPoint5);
|
||||
bandPoint6 = coordinateSystem.transformThisPoint(bandPoint6);
|
||||
|
||||
bandPoint1 = transformThisPoint(bandPoint1, thisObject.container);
|
||||
bandPoint2 = transformThisPoint(bandPoint2, thisObject.container);
|
||||
bandPoint3 = transformThisPoint(bandPoint3, thisObject.container);
|
||||
bandPoint4 = transformThisPoint(bandPoint4, thisObject.container);
|
||||
bandPoint5 = transformThisPoint(bandPoint5, thisObject.container);
|
||||
bandPoint6 = transformThisPoint(bandPoint6, thisObject.container);
|
||||
bandPoint1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(bandPoint1, thisObject.container);
|
||||
bandPoint2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(bandPoint2, thisObject.container);
|
||||
bandPoint3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(bandPoint3, thisObject.container);
|
||||
bandPoint4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(bandPoint4, thisObject.container);
|
||||
bandPoint5 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(bandPoint5, thisObject.container);
|
||||
bandPoint6 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(bandPoint6, thisObject.container);
|
||||
|
||||
if (bandPoint2.x < canvas.chartingSpace.viewport.visibleArea.bottomLeft.x || bandPoint1.x > canvas.chartingSpace.viewport.visibleArea.bottomRight.x) {
|
||||
if (bandPoint2.x < UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.x || bandPoint1.x > UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.x) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_PACKING_OBJECTS_AT_THE_BOTTOM_OR_TOP_OF_VIEWPORT) {
|
||||
let diffA = bandPoint1.y - canvas.chartingSpace.viewport.visibleArea.bottomLeft.y
|
||||
if (UI.projects.superalgos.spaces.chartingSpace.viewport.zoomTargetLevel < UI.projects.superalgos.globals.zoom.ZOOM_OUT_THRESHOLD_FOR_PACKING_OBJECTS_AT_THE_BOTTOM_OR_TOP_OF_VIEWPORT) {
|
||||
let diffA = bandPoint1.y - UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.y
|
||||
if (diffA > 0) {
|
||||
bandPoint1.y = bandPoint1.y - diffA
|
||||
bandPoint2.y = bandPoint2.y - diffA
|
||||
@@ -547,7 +547,7 @@
|
||||
bandPoint6.y = bandPoint6.y - diffA
|
||||
}
|
||||
|
||||
let diffB = bandPoint2.y - canvas.chartingSpace.viewport.visibleArea.topLeft.y
|
||||
let diffB = bandPoint2.y - UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft.y
|
||||
if (diffB < 0) {
|
||||
bandPoint1.y = bandPoint1.y - diffB
|
||||
bandPoint2.y = bandPoint2.y - diffB
|
||||
@@ -558,12 +558,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
bandPoint1 = canvas.chartingSpace.viewport.fitIntoVisibleArea(bandPoint1);
|
||||
bandPoint2 = canvas.chartingSpace.viewport.fitIntoVisibleArea(bandPoint2);
|
||||
bandPoint3 = canvas.chartingSpace.viewport.fitIntoVisibleArea(bandPoint3);
|
||||
bandPoint4 = canvas.chartingSpace.viewport.fitIntoVisibleArea(bandPoint4);
|
||||
bandPoint5 = canvas.chartingSpace.viewport.fitIntoVisibleArea(bandPoint5);
|
||||
bandPoint6 = canvas.chartingSpace.viewport.fitIntoVisibleArea(bandPoint6);
|
||||
bandPoint1 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(bandPoint1);
|
||||
bandPoint2 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(bandPoint2);
|
||||
bandPoint3 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(bandPoint3);
|
||||
bandPoint4 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(bandPoint4);
|
||||
bandPoint5 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(bandPoint5);
|
||||
bandPoint6 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(bandPoint6);
|
||||
|
||||
bandPoint1 = thisObject.fitFunction(bandPoint1);
|
||||
bandPoint2 = thisObject.fitFunction(bandPoint2);
|
||||
@@ -591,9 +591,9 @@
|
||||
}
|
||||
|
||||
if (
|
||||
bandPoint1.x < canvas.chartingSpace.viewport.visibleArea.topLeft.x + 150
|
||||
bandPoint1.x < UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft.x + 150
|
||||
||
|
||||
bandPoint1.x > canvas.chartingSpace.viewport.visibleArea.bottomRight.x - 150
|
||||
bandPoint1.x > UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.x - 150
|
||||
) {
|
||||
// we leave this bands without fill.
|
||||
} else {
|
||||
|
||||
@@ -37,8 +37,8 @@ function newMastersPlottersBollingerBandsBollingerBandsBollingerBandsPanel () {
|
||||
thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL;
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL;
|
||||
|
||||
thisObject.container.frame.position.x = canvas.chartingSpace.viewport.visibleArea.topRight.x - thisObject.container.frame.width * 3;
|
||||
thisObject.container.frame.position.y = canvas.chartingSpace.viewport.visibleArea.bottomLeft.y - thisObject.container.frame.height;
|
||||
thisObject.container.frame.position.x = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight.x - thisObject.container.frame.width * 3;
|
||||
thisObject.container.frame.position.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.y - thisObject.container.frame.height;
|
||||
|
||||
upDownButton = newUpDownButton()
|
||||
upDownButton.parentContainer = thisObject.container
|
||||
@@ -203,18 +203,18 @@ function newMastersPlottersBollingerBandsBollingerBandsBollingerBandsPanel () {
|
||||
|
||||
|
||||
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);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel('Direction', X_AXIS, frameTitleHeight + frameBodyHeight * 0.05, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.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);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel('Moving Average', X_AXIS, frameTitleHeight + frameBodyHeight * 0.15, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.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);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel('Deviation', X_AXIS, frameTitleHeight + frameBodyHeight * 0.85, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.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);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel('Standard Deviation', X_AXIS, frameTitleHeight + frameBodyHeight * 0.95, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel(currentBand.innerBand.standardDeviation, X_AXIS, frameTitleHeight + frameBodyHeight * 0.90, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
|
||||
/* Stop listening to the necesary events. */
|
||||
|
||||
canvas.chartingSpace.viewport.eventHandler.stopListening(zoomChangedEventSubscriptionId);
|
||||
canvas.chartingSpace.viewport.eventHandler.stopListening(offsetChangedEventSubscriptionId);
|
||||
UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.stopListening(zoomChangedEventSubscriptionId);
|
||||
UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.stopListening(offsetChangedEventSubscriptionId);
|
||||
canvas.eventHandler.stopListening(dragFinishedEventSubscriptionId);
|
||||
thisObject.container.eventHandler.stopListening(dimmensionsChangedEventSubscriptionId)
|
||||
marketFiles.eventHandler.stopListening(marketFilesUpdatedEventSubscriptionId);
|
||||
@@ -115,8 +115,8 @@
|
||||
|
||||
/* Listen to the necesary events. */
|
||||
|
||||
zoomChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent("Zoom Changed", onViewportZoomChanged);
|
||||
offsetChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent("Position Changed", onViewportPositionChanged);
|
||||
zoomChangedEventSubscriptionId = UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.listenToEvent("Zoom Changed", onViewportZoomChanged);
|
||||
offsetChangedEventSubscriptionId = UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.listenToEvent("Position Changed", onViewportPositionChanged);
|
||||
dragFinishedEventSubscriptionId = canvas.eventHandler.listenToEvent("Drag Finished", onDragFinished);
|
||||
marketFilesUpdatedEventSubscriptionId = marketFiles.eventHandler.listenToEvent("Files Updated", onMarketFilesUpdated);
|
||||
dailyFilesUpdatedEventSubscriptionId = dailyFiles.eventHandler.listenToEvent("Files Updated", onDailyFilesUpdated);
|
||||
@@ -301,8 +301,8 @@
|
||||
|
||||
let daysOnSides = getSideDays(timeFrame);
|
||||
|
||||
let leftDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, plotAreaFrame);
|
||||
let rightDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topRight, thisObject.container, plotAreaFrame);
|
||||
let leftDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, plotAreaFrame);
|
||||
let rightDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight, thisObject.container, plotAreaFrame);
|
||||
|
||||
let dateDiff = rightDate.valueOf() - leftDate.valueOf();
|
||||
|
||||
@@ -386,8 +386,8 @@
|
||||
|
||||
let daysOnSides = getSideDays(timeFrame);
|
||||
|
||||
let leftDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, plotAreaFrame);
|
||||
let rightDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topRight, thisObject.container, plotAreaFrame);
|
||||
let leftDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, plotAreaFrame);
|
||||
let rightDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight, thisObject.container, plotAreaFrame);
|
||||
|
||||
let dateDiff = rightDate.valueOf() - leftDate.valueOf();
|
||||
|
||||
@@ -480,7 +480,7 @@
|
||||
plotAreaViewport.initializeY(
|
||||
minValue,
|
||||
maxValue,
|
||||
canvas.chartingSpace.viewport.visibleArea.bottomRight.y - canvas.chartingSpace.viewport.visibleArea.topLeft.y
|
||||
UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft.y
|
||||
);
|
||||
|
||||
plotAreaFrame.initializeY(
|
||||
@@ -510,7 +510,7 @@
|
||||
|
||||
/* This next section is to get ready in order to be able to plot dinamically constrained to the viewport */
|
||||
|
||||
let visibleHeight = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - canvas.chartingSpace.viewport.visibleArea.topLeft.y;
|
||||
let visibleHeight = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft.y;
|
||||
|
||||
let frameCorner1 = {
|
||||
x: 0,
|
||||
@@ -524,8 +524,8 @@
|
||||
|
||||
/* Now the transformations. */
|
||||
|
||||
frameCorner1 = transformThisPoint(frameCorner1, thisObject.container.frame.container);
|
||||
frameCorner2 = transformThisPoint(frameCorner2, thisObject.container.frame.container);
|
||||
frameCorner1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(frameCorner1, thisObject.container.frame.container);
|
||||
frameCorner2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(frameCorner2, thisObject.container.frame.container);
|
||||
|
||||
let frameHeightInViewPort = frameCorner2.y - frameCorner1.y;
|
||||
let pbChartHeight = 20;
|
||||
@@ -637,21 +637,21 @@
|
||||
pbPoint9 = plot.transformThisPoint(pbPoint9);
|
||||
pbPoint10 = plot.transformThisPoint(pbPoint10);
|
||||
|
||||
pbPoint1 = transformThisPoint(pbPoint1, thisObject.container);
|
||||
pbPoint2 = transformThisPoint(pbPoint2, thisObject.container);
|
||||
pbPoint1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(pbPoint1, thisObject.container);
|
||||
pbPoint2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(pbPoint2, thisObject.container);
|
||||
|
||||
pbPoint3 = transformThisPoint(pbPoint3, thisObject.container);
|
||||
pbPoint4 = transformThisPoint(pbPoint4, thisObject.container);
|
||||
pbPoint5 = transformThisPoint(pbPoint5, thisObject.container);
|
||||
pbPoint6 = transformThisPoint(pbPoint6, thisObject.container);
|
||||
pbPoint3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(pbPoint3, thisObject.container);
|
||||
pbPoint4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(pbPoint4, thisObject.container);
|
||||
pbPoint5 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(pbPoint5, thisObject.container);
|
||||
pbPoint6 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(pbPoint6, thisObject.container);
|
||||
|
||||
pbPoint7 = transformThisPoint(pbPoint7, thisObject.container);
|
||||
pbPoint8 = transformThisPoint(pbPoint8, thisObject.container);
|
||||
pbPoint7 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(pbPoint7, thisObject.container);
|
||||
pbPoint8 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(pbPoint8, thisObject.container);
|
||||
|
||||
pbPoint9 = transformThisPoint(pbPoint9, thisObject.container);
|
||||
pbPoint10 = transformThisPoint(pbPoint10, thisObject.container);
|
||||
pbPoint9 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(pbPoint9, thisObject.container);
|
||||
pbPoint10 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(pbPoint10, thisObject.container);
|
||||
|
||||
if (pbPoint1.x < canvas.chartingSpace.viewport.visibleArea.bottomLeft.x || pbPoint2.x > canvas.chartingSpace.viewport.visibleArea.bottomRight.x) {
|
||||
if (pbPoint1.x < UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.x || pbPoint2.x > UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.x) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -669,37 +669,37 @@
|
||||
|
||||
/* Now we set the real value of y. */
|
||||
|
||||
pbPoint1.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - (previousPercentBandwidth + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint2.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - (currentPercentBandwidth + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint1.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - (previousPercentBandwidth + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint2.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - (currentPercentBandwidth + pbOffset) * plotAreaViewport.scale.y;
|
||||
|
||||
pbPoint3.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - (0 * pbChartHeight / 100 + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint4.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - (30 * pbChartHeight / 100 + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint5.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - (70 * pbChartHeight / 100 + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint6.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - (100 * pbChartHeight / 100 + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint3.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - (0 * pbChartHeight / 100 + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint4.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - (30 * pbChartHeight / 100 + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint5.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - (70 * pbChartHeight / 100 + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint6.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - (100 * pbChartHeight / 100 + pbOffset) * plotAreaViewport.scale.y;
|
||||
|
||||
pbPoint7.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - (previousMovingAverage + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint8.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - (currentMovingAverage + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint7.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - (previousMovingAverage + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint8.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - (currentMovingAverage + pbOffset) * plotAreaViewport.scale.y;
|
||||
|
||||
pbPoint9.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - (previousBandwidth + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint10.y = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - (currentBandwidth + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint9.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - (previousBandwidth + pbOffset) * plotAreaViewport.scale.y;
|
||||
pbPoint10.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - (currentBandwidth + pbOffset) * plotAreaViewport.scale.y;
|
||||
|
||||
}
|
||||
|
||||
/* Everything must fit within the visible area */
|
||||
|
||||
pbPoint1 = canvas.chartingSpace.viewport.fitIntoVisibleArea(pbPoint1);
|
||||
pbPoint2 = canvas.chartingSpace.viewport.fitIntoVisibleArea(pbPoint2);
|
||||
pbPoint1 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(pbPoint1);
|
||||
pbPoint2 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(pbPoint2);
|
||||
|
||||
pbPoint3 = canvas.chartingSpace.viewport.fitIntoVisibleArea(pbPoint3);
|
||||
pbPoint4 = canvas.chartingSpace.viewport.fitIntoVisibleArea(pbPoint4);
|
||||
pbPoint5 = canvas.chartingSpace.viewport.fitIntoVisibleArea(pbPoint5);
|
||||
pbPoint6 = canvas.chartingSpace.viewport.fitIntoVisibleArea(pbPoint6);
|
||||
pbPoint3 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(pbPoint3);
|
||||
pbPoint4 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(pbPoint4);
|
||||
pbPoint5 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(pbPoint5);
|
||||
pbPoint6 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(pbPoint6);
|
||||
|
||||
pbPoint7 = canvas.chartingSpace.viewport.fitIntoVisibleArea(pbPoint7);
|
||||
pbPoint8 = canvas.chartingSpace.viewport.fitIntoVisibleArea(pbPoint8);
|
||||
pbPoint7 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(pbPoint7);
|
||||
pbPoint8 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(pbPoint8);
|
||||
|
||||
pbPoint9 = canvas.chartingSpace.viewport.fitIntoVisibleArea(pbPoint9);
|
||||
pbPoint10 = canvas.chartingSpace.viewport.fitIntoVisibleArea(pbPoint10);
|
||||
pbPoint9 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(pbPoint9);
|
||||
pbPoint10 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(pbPoint10);
|
||||
|
||||
|
||||
/* Now the drawing of the lines */
|
||||
|
||||
@@ -37,8 +37,8 @@ function newMastersPlottersCandlesVolumesCandlesCandlePanel() {
|
||||
thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL;
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL;
|
||||
|
||||
thisObject.container.frame.position.x = canvas.chartingSpace.viewport.visibleArea.topRight.x - thisObject.container.frame.width * 2;
|
||||
thisObject.container.frame.position.y = canvas.chartingSpace.viewport.visibleArea.bottomLeft.y - thisObject.container.frame.height;
|
||||
thisObject.container.frame.position.x = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight.x - thisObject.container.frame.width * 2;
|
||||
thisObject.container.frame.position.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.y - thisObject.container.frame.height;
|
||||
|
||||
upDownButton = newUpDownButton()
|
||||
upDownButton.parentContainer = thisObject.container
|
||||
@@ -324,27 +324,27 @@ function newMastersPlottersCandlesVolumesCandlesCandlePanel() {
|
||||
|
||||
let y;
|
||||
|
||||
printLabel('Max', X_AXIS, frameTitleHeight + frameBodyHeight * 0.05, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentCandle.innerCandle.max, X_AXIS, frameTitleHeight + frameBodyHeight * 0.10, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel('Max', X_AXIS, frameTitleHeight + frameBodyHeight * 0.05, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel(currentCandle.innerCandle.max, X_AXIS, frameTitleHeight + frameBodyHeight * 0.10, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
printLabel('Min', X_AXIS, frameTitleHeight + frameBodyHeight * 0.95, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentCandle.innerCandle.min, X_AXIS, frameTitleHeight + frameBodyHeight * 0.90, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel('Min', X_AXIS, frameTitleHeight + frameBodyHeight * 0.95, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel(currentCandle.innerCandle.min, X_AXIS, frameTitleHeight + frameBodyHeight * 0.90, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = Y_AXIS - currentCandle.bodyHeight / 2;
|
||||
|
||||
if (y < frameTitleHeight + frameBodyHeight * 0.15) { y = frameTitleHeight + frameBodyHeight * 0.15; }
|
||||
if (y > frameTitleHeight + frameBodyHeight * 0.80) { y = frameTitleHeight + frameBodyHeight * 0.80; }
|
||||
|
||||
printLabel('Open', X_AXIS * 2 / 5, y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentCandle.innerCandle.open, X_AXIS * 2 / 5, y + frameBodyHeight * 0.05, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel('Open', X_AXIS * 2 / 5, y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel(currentCandle.innerCandle.open, X_AXIS * 2 / 5, y + frameBodyHeight * 0.05, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = Y_AXIS + currentCandle.bodyHeight / 2;
|
||||
|
||||
if (y < frameTitleHeight + frameBodyHeight * 0.15) { y = frameTitleHeight + frameBodyHeight * 0.15; }
|
||||
if (y > frameTitleHeight + frameBodyHeight * 0.80) { y = frameTitleHeight + frameBodyHeight * 0.80; }
|
||||
|
||||
printLabel('Close', X_AXIS * 7 / 5, y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentCandle.innerCandle.close, X_AXIS * 7 / 5, y + frameBodyHeight * 0.05, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel('Close', X_AXIS * 7 / 5, y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel(currentCandle.innerCandle.close, X_AXIS * 7 / 5, y + frameBodyHeight * 0.05, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
|
||||
/* Stop listening to the necesary events. */
|
||||
thisObject.container.eventHandler.stopListening(onMouseOverEventSuscriptionId)
|
||||
canvas.chartingSpace.viewport.eventHandler.stopListening(zoomChangedEventSubscriptionId);
|
||||
canvas.chartingSpace.viewport.eventHandler.stopListening(offsetChangedEventSubscriptionId);
|
||||
UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.stopListening(zoomChangedEventSubscriptionId);
|
||||
UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.stopListening(offsetChangedEventSubscriptionId);
|
||||
canvas.eventHandler.stopListening(dragFinishedEventSubscriptionId);
|
||||
thisObject.container.eventHandler.stopListening(dimmensionsChangedEventSubscriptionId)
|
||||
marketFiles.eventHandler.stopListening(marketFilesUpdatedEventSubscriptionId);
|
||||
@@ -110,8 +110,8 @@
|
||||
|
||||
/* Listen to the necesary events. */
|
||||
|
||||
zoomChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent("Zoom Changed", onViewportZoomChanged);
|
||||
offsetChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent("Position Changed", onViewportPositionChanged);
|
||||
zoomChangedEventSubscriptionId = UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.listenToEvent("Zoom Changed", onViewportZoomChanged);
|
||||
offsetChangedEventSubscriptionId = UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.listenToEvent("Position Changed", onViewportPositionChanged);
|
||||
dragFinishedEventSubscriptionId = canvas.eventHandler.listenToEvent("Drag Finished", onDragFinished);
|
||||
marketFilesUpdatedEventSubscriptionId = marketFiles.eventHandler.listenToEvent("Files Updated", onMarketFilesUpdated);
|
||||
dailyFilesUpdatedEventSubscriptionId = dailyFiles.eventHandler.listenToEvent("Files Updated", onDailyFilesUpdated);
|
||||
@@ -146,7 +146,7 @@
|
||||
}
|
||||
|
||||
function onMouseOver(event) {
|
||||
let userPosition = getDateFromPointAtBrowserCanvas(event, thisObject.container, coordinateSystem)
|
||||
let userPosition = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(event, thisObject.container, coordinateSystem)
|
||||
userPositionDate = userPosition.valueOf()
|
||||
}
|
||||
|
||||
@@ -303,8 +303,8 @@
|
||||
|
||||
let daysOnSides = getSideDays(timeFrame);
|
||||
|
||||
let leftDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem);
|
||||
let rightDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem);
|
||||
let leftDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem);
|
||||
let rightDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem);
|
||||
|
||||
let dateDiff = rightDate.valueOf() - leftDate.valueOf();
|
||||
|
||||
@@ -400,8 +400,8 @@
|
||||
|
||||
let daysOnSides = getSideDays(timeFrame);
|
||||
|
||||
let leftDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem);
|
||||
let rightDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem);
|
||||
let leftDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem);
|
||||
let rightDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem);
|
||||
|
||||
let dateDiff = rightDate.valueOf() - leftDate.valueOf();
|
||||
|
||||
@@ -470,7 +470,7 @@
|
||||
try {
|
||||
let elementsPlotted = 0
|
||||
let lowResolution = false
|
||||
if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_PLOTTING_IN_LOW_RESOLUTION) {
|
||||
if (UI.projects.superalgos.spaces.chartingSpace.viewport.zoomTargetLevel < UI.projects.superalgos.globals.zoom.ZOOM_OUT_THRESHOLD_FOR_PLOTTING_IN_LOW_RESOLUTION) {
|
||||
if (candles.length > 100) {
|
||||
lowResolution = true
|
||||
}
|
||||
@@ -512,15 +512,15 @@
|
||||
candle.candlePoint3 = coordinateSystem.transformThisPoint(candle.candlePoint3);
|
||||
candle.candlePoint4 = coordinateSystem.transformThisPoint(candle.candlePoint4);
|
||||
|
||||
candle.candlePoint1 = transformThisPoint(candle.candlePoint1, thisObject.container);
|
||||
candle.candlePoint2 = transformThisPoint(candle.candlePoint2, thisObject.container);
|
||||
candle.candlePoint3 = transformThisPoint(candle.candlePoint3, thisObject.container);
|
||||
candle.candlePoint4 = transformThisPoint(candle.candlePoint4, thisObject.container);
|
||||
candle.candlePoint1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.candlePoint1, thisObject.container);
|
||||
candle.candlePoint2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.candlePoint2, thisObject.container);
|
||||
candle.candlePoint3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.candlePoint3, thisObject.container);
|
||||
candle.candlePoint4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.candlePoint4, thisObject.container);
|
||||
|
||||
/* Skip the first candle with zero at open */
|
||||
if (candle.open === 0) { continue }
|
||||
|
||||
if (candle.candlePoint2.x < canvas.chartingSpace.viewport.visibleArea.bottomLeft.x || candle.candlePoint1.x > canvas.chartingSpace.viewport.visibleArea.bottomRight.x) {
|
||||
if (candle.candlePoint2.x < UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.x || candle.candlePoint1.x > UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.x) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -551,13 +551,13 @@
|
||||
candle.stickPoint3 = coordinateSystem.transformThisPoint(candle.stickPoint3);
|
||||
candle.stickPoint4 = coordinateSystem.transformThisPoint(candle.stickPoint4);
|
||||
|
||||
candle.stickPoint1 = transformThisPoint(candle.stickPoint1, thisObject.container);
|
||||
candle.stickPoint2 = transformThisPoint(candle.stickPoint2, thisObject.container);
|
||||
candle.stickPoint3 = transformThisPoint(candle.stickPoint3, thisObject.container);
|
||||
candle.stickPoint4 = transformThisPoint(candle.stickPoint4, thisObject.container);
|
||||
candle.stickPoint1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.stickPoint1, thisObject.container);
|
||||
candle.stickPoint2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.stickPoint2, thisObject.container);
|
||||
candle.stickPoint3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.stickPoint3, thisObject.container);
|
||||
candle.stickPoint4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.stickPoint4, thisObject.container);
|
||||
|
||||
if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_PACKING_OBJECTS_AT_THE_BOTTOM_OR_TOP_OF_VIEWPORT) {
|
||||
let diffA = candle.stickPoint3.y - canvas.chartingSpace.viewport.visibleArea.bottomLeft.y
|
||||
if (UI.projects.superalgos.spaces.chartingSpace.viewport.zoomTargetLevel < UI.projects.superalgos.globals.zoom.ZOOM_OUT_THRESHOLD_FOR_PACKING_OBJECTS_AT_THE_BOTTOM_OR_TOP_OF_VIEWPORT) {
|
||||
let diffA = candle.stickPoint3.y - UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.y
|
||||
if (diffA > 0) {
|
||||
candle.candlePoint1.y = candle.candlePoint1.y - diffA
|
||||
candle.candlePoint2.y = candle.candlePoint2.y - diffA
|
||||
@@ -570,7 +570,7 @@
|
||||
candle.stickPoint4.y = candle.stickPoint4.y - diffA
|
||||
}
|
||||
|
||||
let diffB = candle.stickPoint1.y - canvas.chartingSpace.viewport.visibleArea.topLeft.y
|
||||
let diffB = candle.stickPoint1.y - UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft.y
|
||||
if (diffB < 0) {
|
||||
candle.candlePoint1.y = candle.candlePoint1.y - diffB
|
||||
candle.candlePoint2.y = candle.candlePoint2.y - diffB
|
||||
@@ -584,20 +584,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
candle.candlePoint1 = canvas.chartingSpace.viewport.fitIntoVisibleArea(candle.candlePoint1);
|
||||
candle.candlePoint2 = canvas.chartingSpace.viewport.fitIntoVisibleArea(candle.candlePoint2);
|
||||
candle.candlePoint3 = canvas.chartingSpace.viewport.fitIntoVisibleArea(candle.candlePoint3);
|
||||
candle.candlePoint4 = canvas.chartingSpace.viewport.fitIntoVisibleArea(candle.candlePoint4);
|
||||
candle.candlePoint1 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(candle.candlePoint1);
|
||||
candle.candlePoint2 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(candle.candlePoint2);
|
||||
candle.candlePoint3 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(candle.candlePoint3);
|
||||
candle.candlePoint4 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(candle.candlePoint4);
|
||||
|
||||
candle.candlePoint1 = thisObject.fitFunction(candle.candlePoint1);
|
||||
candle.candlePoint2 = thisObject.fitFunction(candle.candlePoint2);
|
||||
candle.candlePoint3 = thisObject.fitFunction(candle.candlePoint3);
|
||||
candle.candlePoint4 = thisObject.fitFunction(candle.candlePoint4);
|
||||
|
||||
candle.stickPoint1 = canvas.chartingSpace.viewport.fitIntoVisibleArea(candle.stickPoint1);
|
||||
candle.stickPoint2 = canvas.chartingSpace.viewport.fitIntoVisibleArea(candle.stickPoint2);
|
||||
candle.stickPoint3 = canvas.chartingSpace.viewport.fitIntoVisibleArea(candle.stickPoint3);
|
||||
candle.stickPoint4 = canvas.chartingSpace.viewport.fitIntoVisibleArea(candle.stickPoint4);
|
||||
candle.stickPoint1 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(candle.stickPoint1);
|
||||
candle.stickPoint2 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(candle.stickPoint2);
|
||||
candle.stickPoint3 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(candle.stickPoint3);
|
||||
candle.stickPoint4 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(candle.stickPoint4);
|
||||
|
||||
candle.stickPoint1 = thisObject.fitFunction(candle.stickPoint1);
|
||||
candle.stickPoint2 = thisObject.fitFunction(candle.stickPoint2);
|
||||
|
||||
@@ -37,8 +37,8 @@ function newMastersPlottersCandlesVolumesVolumesVolumePanel() {
|
||||
thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL;
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL;
|
||||
|
||||
thisObject.container.frame.position.x = canvas.chartingSpace.viewport.visibleArea.topRight.x - thisObject.container.frame.width;
|
||||
thisObject.container.frame.position.y = canvas.chartingSpace.viewport.visibleArea.bottomLeft.y - thisObject.container.frame.height;
|
||||
thisObject.container.frame.position.x = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight.x - thisObject.container.frame.width;
|
||||
thisObject.container.frame.position.y = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.y - thisObject.container.frame.height;
|
||||
|
||||
upDownButton = newUpDownButton()
|
||||
upDownButton.parentContainer = thisObject.container
|
||||
@@ -243,11 +243,11 @@ function newMastersPlottersCandlesVolumesVolumesVolumePanel() {
|
||||
|
||||
/* put the labels with the volumes values */
|
||||
|
||||
printLabel('Buy Volume', X_AXIS, frameTitleHeight + frameBodyHeight * 0.95, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentVolume.innerVolumeBar.amountBuy, X_AXIS, frameTitleHeight + frameBodyHeight * 0.90, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel('Buy Volume', X_AXIS, frameTitleHeight + frameBodyHeight * 0.95, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel(currentVolume.innerVolumeBar.amountBuy, X_AXIS, frameTitleHeight + frameBodyHeight * 0.90, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
printLabel('Sell Volume', X_AXIS, frameTitleHeight + frameBodyHeight * 0.05, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(currentVolume.innerVolumeBar.amountSell, X_AXIS, frameTitleHeight + frameBodyHeight * 0.10, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel('Sell Volume', X_AXIS, frameTitleHeight + frameBodyHeight * 0.05, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
UI.projects.superalgos.utilities.drawPrint.printLabel(currentVolume.innerVolumeBar.amountSell, X_AXIS, frameTitleHeight + frameBodyHeight * 0.10, '1.00', 15, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
|
||||
/* Stop listening to the necesary events. */
|
||||
thisObject.container.eventHandler.stopListening(onMouseOverEventSuscriptionId)
|
||||
canvas.chartingSpace.viewport.eventHandler.stopListening(zoomChangedEventSubscriptionId);
|
||||
canvas.chartingSpace.viewport.eventHandler.stopListening(offsetChangedEventSubscriptionId);
|
||||
UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.stopListening(zoomChangedEventSubscriptionId);
|
||||
UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.stopListening(offsetChangedEventSubscriptionId);
|
||||
canvas.eventHandler.stopListening(dragFinishedEventSubscriptionId);
|
||||
thisObject.container.eventHandler.stopListening(dimmensionsChangedEventSubscriptionId)
|
||||
marketFiles.eventHandler.stopListening(marketFilesUpdatedEventSubscriptionId);
|
||||
@@ -118,8 +118,8 @@
|
||||
|
||||
/* Listen to the necesary events. */
|
||||
|
||||
zoomChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent("Zoom Changed", onViewportZoomChanged);
|
||||
offsetChangedEventSubscriptionId = canvas.chartingSpace.viewport.eventHandler.listenToEvent("Position Changed", onViewportPositionChanged);
|
||||
zoomChangedEventSubscriptionId = UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.listenToEvent("Zoom Changed", onViewportZoomChanged);
|
||||
offsetChangedEventSubscriptionId = UI.projects.superalgos.spaces.chartingSpace.viewport.eventHandler.listenToEvent("Position Changed", onViewportPositionChanged);
|
||||
dragFinishedEventSubscriptionId = canvas.eventHandler.listenToEvent("Drag Finished", onDragFinished);
|
||||
marketFilesUpdatedEventSubscriptionId = marketFiles.eventHandler.listenToEvent("Files Updated", onMarketFilesUpdated);
|
||||
dailyFilesUpdatedEventSubscriptionId = dailyFiles.eventHandler.listenToEvent("Files Updated", onDailyFilesUpdated);
|
||||
@@ -154,7 +154,7 @@
|
||||
}
|
||||
|
||||
function onMouseOver(event) {
|
||||
let userPosition = getDateFromPointAtBrowserCanvas(event, thisObject.container, coordinateSystem)
|
||||
let userPosition = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(event, thisObject.container, coordinateSystem)
|
||||
userPositionDate = userPosition.valueOf()
|
||||
}
|
||||
|
||||
@@ -298,8 +298,8 @@
|
||||
|
||||
if (fileCursor.files.size === 0) { return; } // We need to wait until there are files in the cursor
|
||||
|
||||
let leftDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem);
|
||||
let rightDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem);
|
||||
let leftDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem);
|
||||
let rightDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem);
|
||||
|
||||
let dateDiff = rightDate.valueOf() - leftDate.valueOf();
|
||||
|
||||
@@ -382,8 +382,8 @@
|
||||
|
||||
if (marketFile === undefined) { return; } // Initialization not complete yet.
|
||||
|
||||
let leftDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem);
|
||||
let rightDate = getDateFromPointAtBrowserCanvas(canvas.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem);
|
||||
let leftDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft, thisObject.container, coordinateSystem);
|
||||
let rightDate = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight, thisObject.container, coordinateSystem);
|
||||
|
||||
let dateDiff = rightDate.valueOf() - leftDate.valueOf();
|
||||
|
||||
@@ -435,7 +435,7 @@
|
||||
try {
|
||||
|
||||
let lowResolution = false
|
||||
if (canvas.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_PLOTTING_IN_LOW_RESOLUTION) {
|
||||
if (UI.projects.superalgos.spaces.chartingSpace.viewport.zoomTargetLevel < UI.projects.superalgos.globals.zoom.ZOOM_OUT_THRESHOLD_FOR_PLOTTING_IN_LOW_RESOLUTION) {
|
||||
if (volumes.length > 100) {
|
||||
lowResolution = true
|
||||
}
|
||||
@@ -445,7 +445,7 @@
|
||||
|
||||
/* Now we calculate and plot the volumes */
|
||||
|
||||
let visibleHeight = canvas.chartingSpace.viewport.visibleArea.bottomRight.y - canvas.chartingSpace.viewport.visibleArea.topLeft.y;
|
||||
let visibleHeight = UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y - UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft.y;
|
||||
|
||||
let frameCorner1 = {
|
||||
x: 0,
|
||||
@@ -460,8 +460,8 @@
|
||||
|
||||
/* Now the transformations. */
|
||||
|
||||
frameCorner1 = transformThisPoint(frameCorner1, thisObject.container.frame.container);
|
||||
frameCorner2 = transformThisPoint(frameCorner2, thisObject.container.frame.container);
|
||||
frameCorner1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(frameCorner1, thisObject.container.frame.container);
|
||||
frameCorner2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(frameCorner2, thisObject.container.frame.container);
|
||||
|
||||
let frameHeightInViewPort = frameCorner2.y - frameCorner1.y;
|
||||
|
||||
@@ -503,17 +503,17 @@
|
||||
volumePointA3 = plot.transformThisPoint(volumePointA3);
|
||||
volumePointA4 = plot.transformThisPoint(volumePointA4);
|
||||
|
||||
volumePointA1 = transformThisPoint(volumePointA1, thisObject.container);
|
||||
volumePointA2 = transformThisPoint(volumePointA2, thisObject.container);
|
||||
volumePointA3 = transformThisPoint(volumePointA3, thisObject.container);
|
||||
volumePointA4 = transformThisPoint(volumePointA4, thisObject.container);
|
||||
volumePointA1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointA1, thisObject.container);
|
||||
volumePointA2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointA2, thisObject.container);
|
||||
volumePointA3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointA3, thisObject.container);
|
||||
volumePointA4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointA4, thisObject.container);
|
||||
|
||||
let baseIncrement = (volumePointA3.x - volumePointA1.x) * WIDHTER_VOLUME_BAR_BASE_FACTOR;
|
||||
|
||||
volumePointA1.x = volumePointA1.x - baseIncrement;
|
||||
volumePointA4.x = volumePointA4.x + baseIncrement;
|
||||
|
||||
if (volumePointA4.x < canvas.chartingSpace.viewport.visibleArea.bottomLeft.x || volumePointA1.x > canvas.chartingSpace.viewport.visibleArea.bottomRight.x) {
|
||||
if (volumePointA4.x < UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.x || volumePointA1.x > UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.x) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -523,7 +523,7 @@
|
||||
|
||||
if (calculateBuys(coordinateSystem, thisObject.container.frame.height) === false) { continue; } // We try to see if it fits in the visible area.
|
||||
|
||||
let diffA = volumePointA1.y - canvas.chartingSpace.viewport.visibleArea.bottomLeft.y
|
||||
let diffA = volumePointA1.y - UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.y
|
||||
if (diffA > 0) {
|
||||
volumePointA1.y = volumePointA1.y - diffA
|
||||
volumePointA2.y = volumePointA2.y - diffA
|
||||
@@ -563,15 +563,15 @@
|
||||
volumePointB3 = plot.transformThisPoint2(volumePointB3);
|
||||
volumePointB4 = plot.transformThisPoint2(volumePointB4);
|
||||
|
||||
volumePointB1 = transformThisPoint(volumePointB1, thisObject.container);
|
||||
volumePointB2 = transformThisPoint(volumePointB2, thisObject.container);
|
||||
volumePointB3 = transformThisPoint(volumePointB3, thisObject.container);
|
||||
volumePointB4 = transformThisPoint(volumePointB4, thisObject.container);
|
||||
volumePointB1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointB1, thisObject.container);
|
||||
volumePointB2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointB2, thisObject.container);
|
||||
volumePointB3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointB3, thisObject.container);
|
||||
volumePointB4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointB4, thisObject.container);
|
||||
}
|
||||
|
||||
calculateSells(coordinateSystem, thisObject.container.frame.height); // We try to see if it fits in the visible area.
|
||||
|
||||
let diffB = volumePointB1.y - canvas.chartingSpace.viewport.visibleArea.topLeft.y
|
||||
let diffB = volumePointB1.y - UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft.y
|
||||
if (diffB < 0) {
|
||||
volumePointB1.y = volumePointB1.y - diffB
|
||||
volumePointB2.y = volumePointB2.y - diffB
|
||||
@@ -599,15 +599,15 @@
|
||||
|
||||
/* Everything must fit within the visible area */
|
||||
|
||||
volumePointA1 = canvas.chartingSpace.viewport.fitIntoVisibleArea(volumePointA1);
|
||||
volumePointA2 = canvas.chartingSpace.viewport.fitIntoVisibleArea(volumePointA2);
|
||||
volumePointA3 = canvas.chartingSpace.viewport.fitIntoVisibleArea(volumePointA3);
|
||||
volumePointA4 = canvas.chartingSpace.viewport.fitIntoVisibleArea(volumePointA4);
|
||||
volumePointA1 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(volumePointA1);
|
||||
volumePointA2 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(volumePointA2);
|
||||
volumePointA3 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(volumePointA3);
|
||||
volumePointA4 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(volumePointA4);
|
||||
|
||||
volumePointB1 = canvas.chartingSpace.viewport.fitIntoVisibleArea(volumePointB1);
|
||||
volumePointB2 = canvas.chartingSpace.viewport.fitIntoVisibleArea(volumePointB2);
|
||||
volumePointB3 = canvas.chartingSpace.viewport.fitIntoVisibleArea(volumePointB3);
|
||||
volumePointB4 = canvas.chartingSpace.viewport.fitIntoVisibleArea(volumePointB4);
|
||||
volumePointB1 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(volumePointB1);
|
||||
volumePointB2 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(volumePointB2);
|
||||
volumePointB3 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(volumePointB3);
|
||||
volumePointB4 = UI.projects.superalgos.spaces.chartingSpace.viewport.fitIntoVisibleArea(volumePointB4);
|
||||
|
||||
volumePointA1 = thisObject.fitFunction(volumePointA1);
|
||||
volumePointA2 = thisObject.fitFunction(volumePointA2);
|
||||
|
||||
Reference in new issue
Block a user