Merge pull request #519 from Superalgos/develop

Beta 8 SP 4
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-01-31 12:45:09 +01:00
commit c200b94b1a
8 files changed
+73 -30

No files matched your search

+3 -3
View File
@@ -56,8 +56,8 @@
onresize="onResize()">
<div id="contributors" class="credits">
<p id="credits-page-status-paragraph" class="credits-yellow">The UI is loading...</p>
<p>Superalgos is and will always be <span class="credits-red">free</span> and <span class="credits-red">open-source</span>, and is
<span class="credits-red">constantly improving</span> thanks to the involvement of contributors:</p>
<p>Superalgos is <span class="credits-red">forever free</span> and <span class="credits-red">open-source</span>, and it's
<span class="credits-red">relentlessly improving</span> thanks to the involvement of contributors:</p>
<p>Luis Fernando Molina, Julian Molina, Andreja Cobeljic, Matías Benitez, Ira Miller, Eduardo Remis,
Jeff Braun, rico4dev, 9808us, Barry Low, Nikola Bjelogrlic, Hirajin Koizuko, Francisco J. Santillán, Norman,
Viktoria B., Guillermo V., Daniel J.,
@@ -65,7 +65,7 @@
Diego M., CarnivalBen,
Sebastian E., Bogdan P., Marko V., Igor S., Niksa K., Rodrigo M., Nicanor M., Alejandro P., Mateo H., Lan
T., Leon A., Uroš R., Filip M., Vladimir J. and Pavle B.</p>
<p>Thanks for giving a <span class="credits-red">star</span> to the project's <span class="credits-red">repo at GitHub.com</span>. This help other devs to find it.</p>
<p>Thanks for giving a <span class="credits-red">star</span> to the Superalgos <span class="credits-red">repo at GitHub.com</span>... It helps other devs find the project!</p>
</div>
<div id="masterApp"></div>
<div id="canvasApp"></div>
@@ -1 +1 @@
{"type":"Trading Mine","name":"Masters","config":"{ \n\"codeName\": \"Masters\"\n}","project":"Superalgos","tradingBots":[{"type":"Trading Bot","name":"Low Frequency","config":"{\n\"codeName\": \"Low-Frequency\"\n}","project":"Superalgos","processes":[{"type":"Process Definition","name":"Trading","config":"{\n \"codeName\": \"Trading\",\n \"sessionRunWaitTime\": 5000,\n \"retryWaitTime\": 10000,\n \"framework\": {\n \"name\": \"Low-Frequency-Trading-Process\"\n }\n }","project":"Superalgos","processOutput":{"type":"Process Output","name":"New Process Output","project":"Superalgos","outputDatasets":[],"outputDatasetFolders":[{"type":"Output Dataset Folder","name":"Trading Engine","project":"Superalgos","outputDatasets":[],"outputDatasetFolders":[{"type":"Output Dataset Folder","name":"Episode","project":"Superalgos","outputDatasets":[{"type":"Output Dataset","name":"Multi-Period-Market Episode Counters","project":"Superalgos","id":"ec8d74ba-a4ad-417a-b479-6bae95b8a1fe","savedPayload":{"position":{"x":24910.97457254189,"y":18457.46644293786},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"3ed03a02-381d-43fe-9faa-761728c53bd8"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Counters","project":"Superalgos","id":"22b0af33-8c2f-4194-839b-affd18f298d5","savedPayload":{"position":{"x":24834.601232363748,"y":18490.07023931273},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"15f5b150-f1cf-403c-8cb9-2c7c4e1db8e8"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Statistics","project":"Superalgos","id":"23ab91ae-2e78-4993-bb69-855f69cef1ce","savedPayload":{"position":{"x":24753.53736157276,"y":18508.085329665024},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"fc9dc0f7-35e0-4548-bb91-f920825d694f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Statistics","project":"Superalgos","id":"d0a4515a-279d-4c27-8de2-168108861242","savedPayload":{"position":{"x":24670.543493063306,"y":18510.89823169951},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"91953362-8751-4440-a898-21245cd47c15"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Candle","project":"Superalgos","id":"7fc80977-5b37-413e-8107-0a89a16e08b0","savedPayload":{"position":{"x":24588.445883487308,"y":18498.413155411115},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"17fb41f5-61b5-4433-9a10-950ff8216a7e"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Candle","project":"Superalgos","id":"a6888750-1043-420c-9253-633e1399c5e4","savedPayload":{"position":{"x":24510.040268473647,"y":18471.05526509864},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"bbc9467d-28bf-432b-9e49-582d1bcabfb9"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Balances","project":"Superalgos","id":"0ad114df-f076-4a86-8c62-4c4a146da73c","savedPayload":{"position":{"x":24437.996657204443,"y":18429.756200904503},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"acddff59-b51b-4b45-b58f-71d4077755ee"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Balances","project":"Superalgos","id":"04b51302-957d-4365-ad55-9f89d60e261c","savedPayload":{"position":{"x":24374.76840845468,"y":18375.922352927064},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFroLine truncated
{"type":"Trading Mine","name":"Masters","config":"{ \n\"codeName\": \"Masters\"\n}","project":"Superalgos","tradingBots":[{"type":"Trading Bot","name":"Low Frequency","config":"{\n\"codeName\": \"Low-Frequency\"\n}","project":"Superalgos","processes":[{"type":"Process Definition","name":"Trading","config":"{\n \"codeName\": \"Trading\",\n \"sessionRunWaitTime\": 5000,\n \"retryWaitTime\": 10000,\n \"framework\": {\n \"name\": \"Low-Frequency-Trading-Process\"\n }\n }","project":"Superalgos","processOutput":{"type":"Process Output","name":"New Process Output","project":"Superalgos","outputDatasets":[],"outputDatasetFolders":[{"type":"Output Dataset Folder","name":"Trading Engine","project":"Superalgos","outputDatasets":[],"outputDatasetFolders":[{"type":"Output Dataset Folder","name":"Episode","project":"Superalgos","outputDatasets":[{"type":"Output Dataset","name":"Multi-Period-Market Episode Counters","project":"Superalgos","id":"ec8d74ba-a4ad-417a-b479-6bae95b8a1fe","savedPayload":{"position":{"x":24910.97457254189,"y":18457.46644293786},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"3ed03a02-381d-43fe-9faa-761728c53bd8"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Counters","project":"Superalgos","id":"22b0af33-8c2f-4194-839b-affd18f298d5","savedPayload":{"position":{"x":24834.601232363748,"y":18490.07023931273},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"15f5b150-f1cf-403c-8cb9-2c7c4e1db8e8"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Statistics","project":"Superalgos","id":"23ab91ae-2e78-4993-bb69-855f69cef1ce","savedPayload":{"position":{"x":24753.53736157276,"y":18508.085329665024},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"fc9dc0f7-35e0-4548-bb91-f920825d694f"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Statistics","project":"Superalgos","id":"d0a4515a-279d-4c27-8de2-168108861242","savedPayload":{"position":{"x":24670.543493063306,"y":18510.89823169951},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"91953362-8751-4440-a898-21245cd47c15"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Candle","project":"Superalgos","id":"7fc80977-5b37-413e-8107-0a89a16e08b0","savedPayload":{"position":{"x":24588.445883487308,"y":18498.413155411115},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"17fb41f5-61b5-4433-9a10-950ff8216a7e"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Candle","project":"Superalgos","id":"a6888750-1043-420c-9253-633e1399c5e4","savedPayload":{"position":{"x":24510.040268473647,"y":18471.05526509864},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Daily","id":"bbc9467d-28bf-432b-9e49-582d1bcabfb9"}}},{"type":"Output Dataset","name":"Multi-Period-Market Episode Balances","project":"Superalgos","id":"0ad114df-f076-4a86-8c62-4c4a146da73c","savedPayload":{"position":{"x":24437.996657204443,"y":18429.756200904503},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFrozen":false,"isCollapsed":false,"angleToParent":2,"distanceToParent":3,"arrangementStyle":0},"uiObject":{},"referenceParent":{"type":"Dataset Definition","name":"Multi-Period-Market","id":"acddff59-b51b-4b45-b58f-71d4077755ee"}}},{"type":"Output Dataset","name":"Multi-Period-Daily Episode Balances","project":"Superalgos","id":"04b51302-957d-4365-ad55-9f89d60e261c","savedPayload":{"position":{"x":24374.76840845468,"y":18375.922352927064},"targetPosition":{"x":24696.86240363471,"y":18061.668541066385},"floatingObject":{"isPinned":false,"isFroLine truncated
@@ -11,6 +11,18 @@
"style": "Note",
"text": "Candle And Cycle",
"updated": 1611919730247
},
{
"style": "Title",
"text": "Context Info"
},
{
"style": "Text",
"text": "The following is the information preserved at the moment this Info Message was generated:"
},
{
"style": "Placeholder",
"text": "contextInfo"
}
]
}
@@ -214,6 +214,13 @@ exports.newSuperalgosBotModulesTradingSimulation = function (processIndex) {
type: 'TS LF Trading Bot Info - Candle And Cycle',
placeholder: {}
}
contextInfo = {
candleIndex: tradingEngine.current.episode.candle.index.value,
cycle: tradingEngine.current.episode.cycle.value
}
TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, undefined, undefined, undefined, undefined, undefined, contextInfo)
tradingSystem.addInfo([tradingSystem.id, infoMessage, docs])
await tradingSystemModuleObject.run()
@@ -64,43 +64,42 @@ exports.newSuperalgosBotModulesTradingSystem = function (processIndex) {
tradingSystem.addError = function (errorDataArray) {
/*
This function adds to the array of error info a rate based on the amount of items
already at the errors array. This rate will later help plotting the error at the
This function adds to the array of error info a rate.
This rate will later help plotting the error at the
charts.
*/
let baseRate = tradingEngine.current.episode.candle.close.value
let rate = baseRate - baseRate * ((tradingSystem.errors.length + 1) + 0) / 100
let rate = tradingEngine.current.episode.candle.close.value
errorDataArray.push(rate)
tradingSystem.errors.push(errorDataArray)
}
tradingSystem.addWarning = function (warningDataArray) {
/*
This function adds to the array of warning info a rate based on the amount of items
already at the warning array. This rate will later help plotting the warning at the
This function adds to the array of warning info a rate.
This rate will later help plotting the warning at the
charts.
*/
let baseRate = tradingEngine.current.episode.candle.close.value
let rate = baseRate + baseRate * ((tradingSystem.warnings.length + 1) + 0) / 100
let rate = tradingEngine.current.episode.candle.close.value
warningDataArray.push(rate)
tradingSystem.warnings.push(warningDataArray)
}
tradingSystem.addInfo = function (infoDataArray) {
/*
This function adds to the array of warning info a rate based on the amount of items
already at the warning array. This rate will later help plotting the warning at the
This function adds to the array of warning info a rate.
This rate will later help plotting the warning at the
charts.
*/
let baseRate = tradingEngine.current.episode.candle.close.value
let rate = baseRate + baseRate * ((tradingSystem.infos.length + 1) + 0.5) / 100
let rate = tradingEngine.current.episode.candle.close.value
infoDataArray.push(rate)
tradingSystem.infos.push(infoDataArray)
}
function isItInside(elementWithTimestamp, elementWithBeginEnd) {
/*
The function is to allow in Conditions and Formulas to easily know when an element with timestamp (like the ones of single files) are inside the time range
The function is to allow in Conditions and Formulas to easily
know when an element with timestamp (like the ones of
single files) are inside the time range
of an element with a time range, like a candle.
*/
if (elementWithTimestamp.timestamp >= elementWithBeginEnd.begin && elementWithTimestamp.timestamp <= elementWithBeginEnd.end) {
@@ -151,16 +151,20 @@ function newPlotter() {
function onMouseOver(event) {
let userPosition = UI.projects.superalgos.utilities.dateRateTransformations.getDateFromPointAtBrowserCanvas(event, thisObject.container, coordinateSystem)
userPositionDate = userPosition.valueOf()
let rateRange = 10
if (productDefinition.referenceParent.config.rateRange !== undefined) {
rateRange = productDefinition.referenceParent.config.rateRange
}
let minPositionPoint = {
x: event.x,
y: event.y + 10
y: event.y + rateRange
}
minUserPositionRate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtBrowserCanvas(minPositionPoint, thisObject.container, coordinateSystem)
let maxPositionPoint = {
x: event.x,
y: event.y - 10
y: event.y - rateRange
}
maxUserPositionRate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtBrowserCanvas(maxPositionPoint, thisObject.container, coordinateSystem)
}
@@ -530,9 +534,26 @@ function newPlotter() {
position determined by rateInArrayIndex
*/
let rateArray = record[ratePropertyName]
let rateInRange = false
for (let i = 0; i < rateArray.length; i++) {
let rateArrayItem = rateArray[i]
/*
Here we will take the rate for this array item and we will apply the offset
rules defined at the Plotter Module Config for this kind of sitiations.
*/
let rate = rateArrayItem[productDefinition.referenceParent.config.rateInArrayAtIndex]
let point = {
x: 0,
y: rate
}
point = coordinateSystem.transformThisPoint(point)
point = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point, container)
point.y =
point.y -
productDefinition.referenceParent.config.rateOffsetBasedOnArrayIndex * i -
productDefinition.referenceParent.config.rateOffset
rate = UI.projects.superalgos.utilities.dateRateTransformations.getRateFromPointAtBrowserCanvas(point, thisObject.container, coordinateSystem)
/*
We will try to find at which record is the mouse pointer close enough.
*/
@@ -541,17 +562,21 @@ function newPlotter() {
We store the index found here so as to enable whoever receives this
record to know which record the user is pointing at.
*/
DEBUG.variable1 = 'i: ' + i
record.rateIndex = i
currentRecordChanged()
rateInRange = true
break
}
}
/*
If the User is not pointing to a rate in particular we are still going
to raise the event but without a rateindex property
*/
record.rateIndex = undefined
currentRecordChanged()
if (rateInRange === false) {
/*
If the User is not pointing to a rate in particular we are still going
to raise the event but without a rateindex property
*/
record.rateIndex = undefined
currentRecordChanged()
}
} else {
/*
Current Record depends that the mouse pointer is within a range close enought to the rate
@@ -306,8 +306,6 @@ function newFloatingLayer() {
/* This function makes all the calculations to apply phisycs on all visible floatingObjects in this layer. */
try {
DEBUG.variable1 = 'Invisible Floating Objets: ' + invisibleFloatingObjects.length
DEBUG.variable2 = 'Visible Floating Objets: ' + visibleFloatingObjects.length
if (UI.projects.superalgos.spaces.floatingSpace.settings.physics !== true) {return}
+5 -3
View File
@@ -2,7 +2,7 @@
All procedures are the same for Windows, Linux, or Mac OS.
![Superalgos video capture (16)](https://user-images.githubusercontent.com/9479367/77251218-76d25980-6c4d-11ea-8e47-be7db2e8abdb.gif)
![superalgos-readme](https://user-images.githubusercontent.com/13994516/106380124-844d8980-63b0-11eb-9bd9-4f977b6c183b.gif)
# Pre-Requisites
@@ -48,7 +48,9 @@ Before you begin, it is recommended that you set up Chrome/Safari as your defaul
# Superalgos Client Installation
**1.** Scroll the page all the way to the top. Find and click the **Fork** button to create your fork/copy of this repository. To fork Superalgos you need a GitHub account. If you don't have one, go ahead and create it. A Fork is required for your contributions to the project (more on this later).
**1.** Scroll the page all the way to the top. Find and click the **Fork** button to create your fork/copy of this repository. To fork Superalgos you need a GitHub account. If you don't have one, go ahead and create it.
**NOTE:** A Fork is required for your contributions to the project. Superalgos will soon be moving into a new phase of development by incentivizing contributions. Incentives will be retroactive. The earlier in the life of the project you start contributing, the juicier your incentives will be, as the impact of contributions in a Community-driven project is clearly a function of time. This is an open invitation for you to become a vested member of the community!
**2.** Once the fork is created, you will land on the page of your fork. Copy the URL from your browser's address bar.
@@ -78,7 +80,7 @@ git clone https://github.com/John/Superalgos
**3.** You are better off running the git clone command as an administrator to avoid permission issues while creating the Superalgos folder and downloading the repository. It may work without admin powers depending on your setup, particularly if you are running the command on a folder where you've got write permissions.
**4.** Before installing the client on a remote computer in an attempt to access the UI from a different machine, we highly recommend you do a standard installation on your PC / laptop first. Leave your Raspberry Pi or server for later, once you have done all available tutorials. This single tip will save you a lot of time: you don't need to add complexity before you learn how to handle the app.
**4.** Before installing the client on a remote computer in an attempt to access the UI from a different machine, we highly recommend you do a standard installation on your PC / laptop first. Leave your Raspberry Pi or server for later, once you have done all available tutorials. This single tip will save you a lot of time: you don't need to add complexity before you learn how to handle the app.
# Usage