From ebd1148e1f663587bb6d066367674b95e0f9f1b7 Mon Sep 17 00:00:00 2001 From: Smidy13 <77650800+Smidy13@users.noreply.github.com> Date: Sat, 24 Apr 2021 20:44:41 +1200 Subject: [PATCH 1/2] Bug Fix: Close Stage Event not triggering --- .../Superalgos/UI/Function-Libraries/TradingSessionFunctions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Superalgos/UI/Function-Libraries/TradingSessionFunctions.js b/Projects/Superalgos/UI/Function-Libraries/TradingSessionFunctions.js index 706699a193..b16c7e12db 100644 --- a/Projects/Superalgos/UI/Function-Libraries/TradingSessionFunctions.js +++ b/Projects/Superalgos/UI/Function-Libraries/TradingSessionFunctions.js @@ -69,7 +69,6 @@ function newSuperalgosFunctionLibraryTradingSessionFunctions() { 'Manage Stage->' + 'Managed Stop Loss->Managed Take Profit->' + 'Phase->Formula->Next Phase Event->Move To Phase Event->Phase->' + - 'Close Stage Event->' + 'Situation->Condition->Javascript Code->' + 'Close Stage->' + 'Initial Targets->Target Size In Base Asset->Target Size In Quoted Asset->Target Rate->Formula->' + @@ -77,6 +76,7 @@ function newSuperalgosFunctionLibraryTradingSessionFunctions() { 'Execution Algorithm->Market Buy Order->Market Sell Order->Limit Buy Order->Limit Sell Order->' + 'Order Rate->Formula->' + 'Create Order Event->Cancel Order Event->' + + 'Close Stage Event->' + 'Announcement->Announcement Formula->Announcement Condition->' + 'Size In Base Asset->Size In Quoted Asset->Position Rate->Formula->' + 'Situation->Condition->Javascript Code->' + From ffa1b255102cdcf8de9db3fe0cf06c1e7916afa2 Mon Sep 17 00:00:00 2001 From: Smidy13 <77650800+Smidy13@users.noreply.github.com> Date: Sat, 24 Apr 2021 22:13:08 +1200 Subject: [PATCH 2/2] Improvement: Bot Using Commands and Greater Assistance --- .../TS/Bot-Modules/Trading-Bot/Announcements/TelegramBot.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/TelegramBot.js b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/TelegramBot.js index 9b8bff1e49..308ff37d7a 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/TelegramBot.js +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/TelegramBot.js @@ -22,15 +22,15 @@ exports.newSuperalgosBotModulesTelegramBot = function (processIndex) { thisObject.telegramBot = new Telegraf(botToken) thisObject.telegramBot.start((ctx) => ctx.reply('Hi! I am the Telegram Bot that will tell you what happens with your trading session.')) - thisObject.telegramBot.help((ctx) => ctx.reply('I can stop the session if you type STOP.')) - thisObject.telegramBot.hears('STOP', (ctx) => TS.projects.superalgos.functionLibraries.sessionFunctions.stopSession(processIndex, ' by STOP command at Telegram.')) + thisObject.telegramBot.help((ctx) => ctx.replyWithHTML('SUPERALGOS BOT HELP\n\n• Use /stop to stop the session.\n• Use /help to receive this help message.')) + thisObject.telegramBot.command('stop', (ctx) => TS.projects.superalgos.functionLibraries.sessionFunctions.stopSession(processIndex, 'by command from Telegram.')) thisObject.telegramBot.launch() const Telegram = require('telegraf/telegram') thisObject.telegramAPI = new Telegram(botToken) - const message = "Telegram bot is starting." + const message = "Telegram bot is starting. For assistance type /help." thisObject.telegramAPI.sendMessage(thisObject.chatId, message).catch(err => parentLogger.write(MODULE_NAME, "[WARN] initializeTelegramBot -> Telegram API error -> err = " + err)) } catch (err) {