Merge pull request #700 from Smidy13/develop
Bug Fix: Telegram Announcement Formula and Condition Changes
This commit is contained in:
2 files changed
+26
-6
No files matched your search
+25
-4
@@ -37,7 +37,7 @@ exports.newSuperalgosBotModulesAnnouncements = function (processIndex) {
|
||||
conditionValue = eval(announcement.announcementCondition.code)
|
||||
} catch (err) {
|
||||
|
||||
const message = 'Annoucement Condition Evaluation Error'
|
||||
const message = 'Announcement Condition Evaluation Error'
|
||||
let docs = {
|
||||
project: 'Superalgos',
|
||||
category: 'Topic',
|
||||
@@ -53,8 +53,29 @@ exports.newSuperalgosBotModulesAnnouncements = function (processIndex) {
|
||||
}
|
||||
if (canAnnounce === true) {
|
||||
let text = announcement.config.text
|
||||
if (announcement.formula !== undefined) {
|
||||
text = tradingSystem.formulas.get(announcement.formula.id)
|
||||
if (announcement.announcementFormula !== undefined) {
|
||||
let formulaValue
|
||||
let errorMessage
|
||||
|
||||
try {
|
||||
formulaValue = eval(announcement.announcementFormula.code)
|
||||
} catch (err) {
|
||||
|
||||
errorMessage = err.message
|
||||
const message = 'Announcement Formula Evaluation Error'
|
||||
let docs = {
|
||||
project: 'Superalgos',
|
||||
category: 'Topic',
|
||||
type: 'TS LF Trading Bot Error - ' + message,
|
||||
placeholder: {}
|
||||
}
|
||||
|
||||
TS.projects.superalgos.utilities.docsFunctions.buildPlaceholder(docs, err, announcement.announcementFormula.name, announcement.announcementFormula.code, undefined, undefined, undefined)
|
||||
|
||||
tradingSystem.addError([announcement.announcementFormula.id, err.message, docs])
|
||||
}
|
||||
if (errorMessage == undefined) { text = formulaValue }
|
||||
|
||||
}
|
||||
|
||||
if (TS.projects.superalgos.globals.processConstants.CONSTANTS_BY_PROCESS_INDEX_MAP.get(processIndex).SESSION_NODE.socialBots !== undefined) {
|
||||
@@ -75,4 +96,4 @@ exports.newSuperalgosBotModulesAnnouncements = function (processIndex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,6 @@ function newSuperalgosFunctionLibraryTradingSessionFunctions() {
|
||||
'Dynamic Indicators->Indicator Function->Formula->' +
|
||||
'Trading Strategy->' +
|
||||
'Trigger Stage->Trigger On Event->Trigger Off Event->Take Position Event->' +
|
||||
'Announcement->Announcement Formula->' +
|
||||
'Open Stage->' +
|
||||
'Manage Stage->' +
|
||||
'Managed Stop Loss->Managed Take Profit->' +
|
||||
@@ -74,7 +73,7 @@ function newSuperalgosFunctionLibraryTradingSessionFunctions() {
|
||||
'Situation->Condition->Javascript Code->' +
|
||||
'Close Stage->' +
|
||||
'Initial Targets->Target Size In Base Asset->Target Size In Quoted Asset->Target Rate->Formula->' +
|
||||
'Announcement->Announcement Formula->' +
|
||||
'Announcement->Announcement Formula->Announcement Condition->' +
|
||||
'Open Execution->Close Execution->' +
|
||||
'Execution Algorithm->Market Buy Order->Market Sell Order->Limit Buy Order->Limit Sell Order->' +
|
||||
'Order Rate->Formula->' +
|
||||
|
||||
Reference in new issue
Block a user