Announcements Plotted at Trading System
This commit is contained in:
1 parent
aacc90c721
commit
b35bade968
3 files changed
+10
-2
No files matched your search
@@ -8,18 +8,20 @@ exports.newAnnouncements = function newAnnouncements(bot, logger) {
|
||||
finalize: finalize
|
||||
}
|
||||
|
||||
let tradingSystem
|
||||
let tradingEngine
|
||||
let announcementsToBeMade = []
|
||||
|
||||
return thisObject
|
||||
|
||||
function initialize() {
|
||||
tradingSystem = bot.simulationState.tradingSystem
|
||||
tradingEngine = bot.simulationState.tradingEngine
|
||||
}
|
||||
|
||||
function finalize() {
|
||||
tradingSystem = undefined
|
||||
tradingEngine = undefined
|
||||
announcementsToBeMade = undefined
|
||||
bot.SESSION.messagesSent = undefined
|
||||
}
|
||||
|
||||
function makeAnnoucements(node) {
|
||||
@@ -48,6 +50,7 @@ exports.newAnnouncements = function newAnnouncements(bot, logger) {
|
||||
|
||||
if (bot.SESSION.socialBots !== undefined) {
|
||||
bot.SESSION.socialBots.announce(text)
|
||||
tradingSystem.announcements.push([announcement.id, text])
|
||||
} else {
|
||||
tradingSystem.errors.push([announcement.id, 'Could not announce because session does not have Social Bots.'])
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ exports.newTradingRecords = function newTradingRecords(bot, logger) {
|
||||
|
||||
let tradingEngine
|
||||
let tradingSystem
|
||||
let sessionParameters
|
||||
let outputDatasetsMap
|
||||
|
||||
return thisObject
|
||||
@@ -19,12 +20,14 @@ exports.newTradingRecords = function newTradingRecords(bot, logger) {
|
||||
function initialize(pOutputDatasetsMap) {
|
||||
tradingEngine = bot.simulationState.tradingEngine
|
||||
tradingSystem = bot.simulationState.tradingSystem
|
||||
sessionParameters = bot.SESSION.parameters
|
||||
outputDatasetsMap = pOutputDatasetsMap // These are the files turned into arrays, stored in a Map by Product codeName.
|
||||
}
|
||||
|
||||
function finalize() {
|
||||
tradingEngine = undefined
|
||||
tradingSystem = undefined
|
||||
sessionParameters = undefined
|
||||
outputDatasetsMap = undefined
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ exports.newTradingSystem = function newTradingSystem(bot, logger) {
|
||||
}
|
||||
|
||||
function reset(pChart) {
|
||||
/* This function helps reset data structures at every cycle of the simulation loop/=. */
|
||||
chart = pChart // We need chat to be a local object accessible from conditions and formulas.
|
||||
tradingSystem.highlights = []
|
||||
tradingSystem.errors = []
|
||||
@@ -94,6 +95,7 @@ exports.newTradingSystem = function newTradingSystem(bot, logger) {
|
||||
tradingSystem.status = []
|
||||
tradingSystem.progress = []
|
||||
tradingSystem.running = []
|
||||
tradingSystem.announcements = []
|
||||
}
|
||||
|
||||
function mantainStrategies() {
|
||||
|
||||
Reference in new issue
Block a user