Orders Calculations and Orders Simulations Warning UX Improved

This commit is contained in:
Luis Fernando Molina committed 2021-01-28 10:29:00 +01:00
1 parent 2e9f809f37
commit 6d7a0c7bd2
6 files changed
+185 -2

No files matched your search

@@ -16,6 +16,19 @@
"style": "Warning",
"text": "Slippage Substracted"
},
{
"style": "Title",
"text": "Why This?",
"updated": 1611825720103
},
{
"style": "Text",
"text": "Check below how the Actual Rate is treated during a Simulation."
},
{
"style": "Include",
"text": "Superalgos->Topic->Simulating Sync With the Exchange->Actual Rate Simulation"
},
{
"style": "Title",
"text": "Context Info"
@@ -16,6 +16,19 @@
"style": "Warning",
"text": "Slippage Added"
},
{
"style": "Title",
"text": "Why This?",
"updated": 1611825659055
},
{
"style": "Text",
"text": "Check below how the Actual Rate is treated during a Simulation."
},
{
"style": "Include",
"text": "Superalgos->Topic->Simulating Sync With the Exchange->Actual Rate Simulation"
},
{
"style": "Title",
"text": "Context Info"
@@ -16,6 +16,19 @@
"style": "Warning",
"text": "Actual Rate Based On Formula"
},
{
"style": "Title",
"text": "Why This?",
"updated": 1611825630727
},
{
"style": "Text",
"text": "Check below how the Actual Rate is treated during a Simulation."
},
{
"style": "Include",
"text": "Superalgos->Topic->Simulating Sync With the Exchange->Actual Rate Simulation"
},
{
"style": "Title",
"text": "Context Info"
@@ -0,0 +1,57 @@
{
"topic": "TS LF Trading Bot Warnings",
"pageNumber": "8",
"type": "TS LF Trading Bot Warning - Simulating - Actual Rate Too Hight",
"definition": {
"text": "The Actual Rate was adjusted to the Candle Max value because we had a Buy Order whose Actual Rate was above the Current Candle Max.",
"updated": 1611823586499
},
"paragraphs": [
{
"style": "Text",
"text": "This is normal behaviour you should not worry about. This warning is created in order to let you know that this happened and help you track the details of each trade.",
"updated": 1611823620818
},
{
"style": "Warning",
"text": "Actual Rate Too Hight"
},
{
"style": "Title",
"text": "Why This?",
"updated": 1611825558276
},
{
"style": "Text",
"text": "Check below how the Actual Rate is treated during a Simulation."
},
{
"style": "Include",
"text": "Superalgos->Topic->Simulating Sync With the Exchange->Actual Rate Simulation"
},
{
"style": "Title",
"text": "Context Info"
},
{
"style": "Text",
"text": "The following are the values of variables at the time this warning was created. They might be useful for you to understand what exactly happened."
},
{
"style": "Placeholder",
"text": "contextInfo"
},
{
"style": "Title",
"text": "Learn More"
},
{
"style": "Text",
"text": "To learn more about this topic, please read the following page:"
},
{
"style": "List",
"text": "Simulating Sync With the Exchange"
}
]
}
@@ -0,0 +1,57 @@
{
"topic": "TS LF Trading Bot Warnings",
"pageNumber": "9",
"type": "TS LF Trading Bot Warning - Simulating - Actual Rate Too Low",
"definition": {
"text": "The Actual Rate was adjusted to the Candle Min value because we had a Sell Order whose Actual Rate was below the Current Candle Min.",
"updated": 1611823586499
},
"paragraphs": [
{
"style": "Text",
"text": "This is normal behaviour you should not worry about. This warning is created in order to let you know that this happened and help you track the details of each trade.",
"updated": 1611823620818
},
{
"style": "Warning",
"text": "Actual Rate Too Low"
},
{
"style": "Title",
"text": "Why This?",
"updated": 1611825558276
},
{
"style": "Text",
"text": "Check below how the Actual Rate is treated during a Simulation."
},
{
"style": "Include",
"text": "Superalgos->Topic->Simulating Sync With the Exchange->Actual Rate Simulation"
},
{
"style": "Title",
"text": "Context Info"
},
{
"style": "Text",
"text": "The following are the values of variables at the time this warning was created. They might be useful for you to understand what exactly happened."
},
{
"style": "Placeholder",
"text": "contextInfo"
},
{
"style": "Title",
"text": "Learn More"
},
{
"style": "Text",
"text": "To learn more about this topic, please read the following page:"
},
{
"style": "List",
"text": "Simulating Sync With the Exchange"
}
]
}
@@ -208,10 +208,25 @@ exports.newSuperalgosBotModulesOrdersSimulations = function (processIndex) {
switch (true) {
case tradingSystemOrder.type === 'Market Buy Order' || tradingSystemOrder.type === 'Limit Buy Order': {
if (tradingEngineOrder.orderStatistics.actualRate.value > tradingEngine.current.episode.candle.max.value) {
const message = 'Simulating - Actual Rate Too Hight'
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS LF Trading Bot Warning - ' + message,
placeholder: {}
}
contextInfo = {
previousActualRate: tradingEngineOrder.orderStatistics.actualRate.value,
recalculatedActualRate: tradingEngine.current.episode.candle.max.value
}
TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, undefined, undefined, undefined, undefined, undefined, contextInfo)
tradingSystem.warnings.push(
[
[tradingEngineOrder.orderStatistics.actualRate.id, tradingEngine.current.episode.candle.max.id],
'Actual Rate (' + tradingEngineOrder.orderStatistics.actualRate.value + ') too high. Changed to candle.max (' + tradingEngine.current.episode.candle.max.value + ')'
message,
docs
]
)
tradingEngineOrder.orderStatistics.actualRate.value = tradingEngine.current.episode.candle.max.value
@@ -220,10 +235,25 @@ exports.newSuperalgosBotModulesOrdersSimulations = function (processIndex) {
}
case tradingSystemOrder.type === 'Market Sell Order' || tradingSystemOrder.type === 'Limit Sell Order': {
if (tradingEngineOrder.orderStatistics.actualRate.value < tradingEngine.current.episode.candle.min.value) {
const message = 'Simulating - Actual Rate Too Low'
let docs = {
project: 'Superalgos',
category: 'Topic',
type: 'TS LF Trading Bot Warning - ' + message,
placeholder: {}
}
contextInfo = {
previousActualRate: tradingEngineOrder.orderStatistics.actualRate.value,
recalculatedActualRate: tradingEngine.current.episode.candle.max.value
}
TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, undefined, undefined, undefined, undefined, undefined, contextInfo)
tradingSystem.warnings.push(
[
[tradingEngineOrder.orderStatistics.actualRate.id, tradingEngine.current.episode.candle.min.id],
'Actual Rate (' + tradingEngineOrder.orderStatistics.actualRate.value + ') too low. Changed to candle.min (' + tradingEngine.current.episode.candle.max.value + ')'
message,
docs
]
)
tradingEngineOrder.orderStatistics.actualRate.value = tradingEngine.current.episode.candle.min.value