From dbe04b9dea570ff64c8684b8c484e59afa14c7a8 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 28 Feb 2018 09:08:59 +0100 Subject: [PATCH] Mariam History set up --- .vs/AAWebPlatform/v15/.suo | Bin 68608 -> 74752 bytes AAWebPlatform.njsproj | 3 ++ File.js | 63 +++++++++++++++++++++++++++++++++++++ Panels/ChartLayersPanel.js | 4 +-- SplashScreen.js | 2 +- TimelineChart.js | 34 ++++++++++++-------- index.html | 1 + 7 files changed, 91 insertions(+), 16 deletions(-) create mode 100644 File.js diff --git a/.vs/AAWebPlatform/v15/.suo b/.vs/AAWebPlatform/v15/.suo index a3d343eb56d26d04684115ba7e8bf1348d0eac6a..21a56f47b7196c7607fefa6d060beffbe87f7bb7 100644 GIT binary patch delta 2132 zcmeHIZA@Eb6u$56y)9*Jp)v}(g+RAVioK|1(UFi^`kLTJHegk=WKkC7hfW=^EN1EtiCKb@X+3XSKB^?fW$~A% zd2*lg`M&p@)7Tq7bE=7ev^ zGyR?o@Rhh;VCTcU7*bAbbG*BB?9&(*G0;U-J<;z#&T1{m9k5N^x$()2^(lOIA-WMk z1S?0U)#ZfV)CeT53Gy_U-$&y4#abvXye`{$xs;EWB#4&Vgy9zo$t18v6SXuOp6tSKLHP9cM_qE}{5)QMhq$YdXFD zEm8Y2X1szpjCcb}kw_+eki?sV8s$#3+e_(l9WN1ffq`QpDW%m9MpPnUO@@O9%=E@1 z8r_>6`}s_q?C0aV65>jL7{JIR{jK|XBkehUn8<^?d|V+9Dda&VOq{Nxbt9jWb@oz@ zE5N`!ZU`pN1>oEVc`z|tPKV##MaT(e5}JMfz2J)8lTjPJem_$o`HoCZVMK{M!h_A% zYV&pM*}LDeFBtHLLI>sA=6_^i_WFd~H%}wN=6V zRnv0U#CyoiDNooJhV2(6kYY{n`;1YY`s%PSdf(MaLadZrOA>HRdjHegwgL$m2Ikd7 zGjNHJTx$M)nt_5IprF@--s~1Z^HCw#q`>3F5t_5aWYH0Y!umajR*C$qosdq-cX7veK8diUV%eME^0-=pPa_8DWb^Vju__8(n?gjp6XeUp~#} z?)$#?z30bW&-hF+_A7fM*tf&!*Cfd)NfIMw3xxumBp@n|cT_O@)PWP(^W(gq4TJq9 z+Ot*IG5ZT-uu6GeZ3S;1X_0p!*5QNB zZIxmK5liW6Kk*_lKnxQ6YiAg6y-!2Ur9gpuT~EpIF%Eim!z5m#qs0f894>Z?9D;}G z9;_|>E*;82F)XK5B_Xoo(3V=8SUC7^)hbIro&($5=s5Js?d~4oB1GU&xWqiBfrr=B zhU}PQ4SZn5!D8&T1^J`RDcIK+Oy8Z8|Ct`Iwyd4Ex4vUrWcR1r2Hf^eN?qp1SZ5yA z;NZI5?$xv*UZIG&n$P+m$nRXgSN*Foe)S2rCsD-`&$IZ}9c-DO$2wnw#6~4Ousy`C zNci%|8>lxtjeE?;T#{5ruW9awm&{T;XI6t3VSfSjw~Y9xjt#Hti34(cOh`iz)Q$rRvuSgbdl;z@TSEd|9X5%I)Iy} zFBL7jF$H!_Cvn4jDeTVlE)4UZa|9SZGBfPGypT{Tx4tC(5cShfeH+;OV;$C|?#DwP z6)hfD6j>Ou2UCqIT4zf5k~8Yfvx(0q@PB6Go2UE1`_rQKCP{Dkm-guCUi4wd%r5VS z8*WM3O4{)^cMC?CgWP2f`MQ(edgUyL1N(^KYEl6v82sx%s98Dzn{1a1ij0pWAV&y)kPrFyy2Ilo5@--Y*)0SgluPpYehM oSZhYjMh*5X-fm;2&j%AGtAaLB#ev_i^_ZV5g$r3R diff --git a/AAWebPlatform.njsproj b/AAWebPlatform.njsproj index 8a7d5eba3..44087a8c1 100644 --- a/AAWebPlatform.njsproj +++ b/AAWebPlatform.njsproj @@ -39,6 +39,9 @@ Code + + Code + Code diff --git a/File.js b/File.js new file mode 100644 index 000000000..b1821f154 --- /dev/null +++ b/File.js @@ -0,0 +1,63 @@ + +function newFile() { + + let fileObject = { + getFile: getFile, + initialize: initialize + } + + let fileCloud; + let file; + + return fileObject; + + function initialize(pTeamCodeName, pBotCodeName, pProductCodeName, pLayerCodeName, pExchange, pMarket, callBackFunction) { + + let product = ecosystem.getProduct(ecosystem.getBot(ecosystem.getTeam(pTeamCodeName), pBotCodeName), pProductCodeName); + + if (product === undefined) { + + throw "Product not found at this bot of the ecosystem! - pTeamCodeName = " + pTeamCodeName + ", pBotCodeName = " + pBotCodeName + ", pProductCodeName = " + pProductCodeName; + + } + + let exchange = ecosystem.getExchange(product, pExchange); + + if (exchange === undefined) { + + throw "Exchange not supoorted by this product of the ecosystem! - pTeamCodeName = " + pTeamCodeName + ", pBotCodeName = " + pBotCodeName + ", pProductCodeName = " + pProductCodeName + ", pExchange = " + pExchange; + + } + + let layer = ecosystem.getLayer(product, pLayerCodeName); + + if (layer === undefined) { + + throw "Layer not found at this product of the ecosystem! - pTeamCodeName = " + pTeamCodeName + ", pBotCodeName = " + pBotCodeName + ", pProductCodeName = " + pProductCodeName + ", pLayerCodeName = " + pLayerCodeName; + + } + + fileCloud = newFileCloud(); + fileCloud.initialize(pTeamCodeName, pBotCodeName); + + /* Now we will get the file */ + + fileCloud.getFile(product, exchange, pMarket, undefined, undefined, onFileReceived); + + function onFileReceived(pFile) { + + file = pFile; + + callBackFunction(); + + } + + } + + function getFile() { + + return file; + + } + +} \ No newline at end of file diff --git a/Panels/ChartLayersPanel.js b/Panels/ChartLayersPanel.js index c01488e4d..189d6673d 100644 --- a/Panels/ChartLayersPanel.js +++ b/Panels/ChartLayersPanel.js @@ -69,9 +69,9 @@ function newChartLayersPanel() { LAYER_NAMES.OLIVIA_CANDLES, LAYER_NAMES.OLIVIA_VOLUMES, LAYER_NAMES.TOM_CANDLE_STAIRS, + LAYER_NAMES.TOM_VOLUME_STAIRS, + LAYER_NAMES.MARIAM_TRADE_HISTORY, LAYER_NAMES.MARIAM_TRADES_DETAILS, - LAYER_NAMES.MARIAM_TRADE_HISTORY, - LAYER_NAMES.MARIAM_TRADE_HISTORY, LAYER_NAMES.ATH, LAYER_NAMES.HIGH_LOWS, LAYER_NAMES.FORECAST, diff --git a/SplashScreen.js b/SplashScreen.js index 07711226e..bfbc2ce07 100644 --- a/SplashScreen.js +++ b/SplashScreen.js @@ -63,7 +63,7 @@ function newSplashScreen() { splashScreen.container.frame.draw(false, false); let label = '' + Math.trunc(stepsInitializationCounter) + ' %'; - stepsInitializationCounter = stepsInitializationCounter + 0.3; + stepsInitializationCounter = stepsInitializationCounter + 0.2; if (stepsInitializationCounter > 99) { stepsInitializationCounter = 99;} diff --git a/TimelineChart.js b/TimelineChart.js index e168736f8..256fb4f75 100644 --- a/TimelineChart.js +++ b/TimelineChart.js @@ -131,9 +131,11 @@ function newTimelineChart() { layerStatus = chartLayersPanel.getLayerStatus(chartLayersPanel.layerNames.OLIVIA_CANDLES); - layerAAMastersAAOliviaCandlesticks.initialize(DEFAULT_EXCHANGE, DEFAULT_MARKET, INITIAL_DATE, INITIAL_TIME_PERIOD, layerStatus, onOliviaCandlesInitialized); + layerAAMastersAAOliviaCandlesticks.initialize(DEFAULT_EXCHANGE, DEFAULT_MARKET, INITIAL_DATE, INITIAL_TIME_PERIOD, layerStatus, onInizialized); - function onOliviaCandlesInitialized() { + function onInizialized() { + + console.log("loadCandles"); layerAAMastersAAOliviaCandlesticks.positionAtDatetime(INITIAL_DATE); loadVolumes(); @@ -162,10 +164,11 @@ function newTimelineChart() { layerStatus = chartLayersPanel.getLayerStatus(chartLayersPanel.layerNames.OLIVIA_VOLUMES); - layerAAMastersAAOliviaVolumes.initialize(DEFAULT_EXCHANGE, DEFAULT_MARKET, INITIAL_DATE, INITIAL_TIME_PERIOD, layerStatus, onOliviaVolumesInitialized); + layerAAMastersAAOliviaVolumes.initialize(DEFAULT_EXCHANGE, DEFAULT_MARKET, INITIAL_DATE, INITIAL_TIME_PERIOD, layerStatus, onInizialized); - function onOliviaVolumesInitialized() { + function onInizialized() { + console.log("loadVolumes"); loadCandleStairs(); } @@ -193,10 +196,11 @@ function newTimelineChart() { layerStatus = chartLayersPanel.getLayerStatus(chartLayersPanel.layerNames.TOM_CANDLE_STAIRS); - layerAAMastersAATomCandleStairs.initialize(DEFAULT_EXCHANGE, DEFAULT_MARKET, INITIAL_DATE, INITIAL_TIME_PERIOD, layerStatus, onOliviaCandlesInitialized); + layerAAMastersAATomCandleStairs.initialize(DEFAULT_EXCHANGE, DEFAULT_MARKET, INITIAL_DATE, INITIAL_TIME_PERIOD, layerStatus, onInizialized); - function onOliviaCandlesInitialized() { + function onInizialized() { + console.log("loadCandleStairs"); loadVolumeStairs(); } @@ -225,12 +229,12 @@ function newTimelineChart() { layerStatus = chartLayersPanel.getLayerStatus(chartLayersPanel.layerNames.TOM_VOLUME_STAIRS); - layerAAMastersAATomVolumeStairs.initialize(DEFAULT_EXCHANGE, DEFAULT_MARKET, INITIAL_DATE, INITIAL_TIME_PERIOD, layerStatus, onOliviaVolumeStairsInitialized); + layerAAMastersAATomVolumeStairs.initialize(DEFAULT_EXCHANGE, DEFAULT_MARKET, INITIAL_DATE, INITIAL_TIME_PERIOD, layerStatus, onInizialized); - function onOliviaVolumeStairsInitialized() { + function onInizialized() { - addLayers(); - splashScreenNeeded = false; // This is when we dont need a splash screen anymore! + console.log("loadVolumeStairs"); + loadMariamHistory(); } @@ -242,7 +246,7 @@ function newTimelineChart() { let layerAAMastersAAMariamTradingHistory = newAAMastersAAMariamTradingHistory(); - function loadVolumeStairs() { + function loadMariamHistory() { layerAAMastersAAMariamTradingHistory.container.displacement.parentDisplacement = timelineChart.container.displacement; layerAAMastersAAMariamTradingHistory.container.zoom.parentZoom = timelineChart.container.zoom; @@ -258,10 +262,11 @@ function newTimelineChart() { layerStatus = chartLayersPanel.getLayerStatus(chartLayersPanel.layerNames.MARIAM_TRADE_HISTORY); - layerAAMastersAAMariamTradingHistory.initialize(DEFAULT_EXCHANGE, DEFAULT_MARKET, INITIAL_DATE, INITIAL_TIME_PERIOD, layerStatus, onOliviaVolumeStairsInitialized); + layerAAMastersAAMariamTradingHistory.initialize(DEFAULT_EXCHANGE, DEFAULT_MARKET, INITIAL_DATE, INITIAL_TIME_PERIOD, layerStatus, onInizialized); - function onOliviaVolumeStairsInitialized() { + function onInizialized() { + console.log("loadMariamHistory"); addLayers(); splashScreenNeeded = false; // This is when we dont need a splash screen anymore! @@ -461,6 +466,8 @@ function newTimelineChart() { timelineChart.layers.push(layerAAMastersAAOliviaCandlesticks); timelineChart.layers.push(layerAAMastersAAOliviaVolumes); + timelineChart.layers.push(layerAAMastersAAMariamTradingHistory); + /* Connecting all layers to the panel that provides a user interface to turn them on - visible - off */ chartLayersPanel.container.eventHandler.listenToEvent("Layer Status Changed", layerAAMastersAAOliviaCandlesticks.onLayerStatusChanged); @@ -469,6 +476,7 @@ function newTimelineChart() { chartLayersPanel.container.eventHandler.listenToEvent("Layer Status Changed", layerAAMastersAATomCandleStairs.onLayerStatusChanged); chartLayersPanel.container.eventHandler.listenToEvent("Layer Status Changed", layerAAMastersAATomVolumeStairs.onLayerStatusChanged); + chartLayersPanel.container.eventHandler.listenToEvent("Layer Status Changed", layerAAMastersAAMariamTradingHistory.onLayerStatusChanged); } /* Add all layers to the internal array */ diff --git a/index.html b/index.html index d3da5c2d3..98e9ce4a7 100644 --- a/index.html +++ b/index.html @@ -14,6 +14,7 @@ +