Bug Fix: Allow Announcements on Create Order Events

This commit is contained in:
Smidy13 committed 2021-04-06 10:40:38 +12:00
1 parent 52b9d29c58
commit 2bc7f91641
2 files changed
+6 -2

No files matched your search

@@ -408,12 +408,15 @@ exports.newSuperalgosBotModulesTradingStages = function (processIndex) {
function runWhenStatusIsOpening() {
/* Opening Status Procedure */
if (tradingEngine.tradingCurrent.strategyManageStage.status.value === 'Opening') {
let strategy = tradingSystem.tradingStrategies[tradingEngine.tradingCurrent.strategy.index.value]
let manageStage = strategy.manageStage
/*
The system allows the user not to define a Manage Stage, because the Manage Stage is optional.
Here we are going to see if that is the case and if it is, we will inmidiatelly consider
the Manage Stage as closed.
*/
if (tradingSystem.tradingStrategies[tradingEngine.tradingCurrent.strategy.index.value].manageStage === undefined) {
if (manageStage === undefined) {
changeStageStatus('Manage Stage', 'Closed', 'Manage Stage Undefined')
changeStageStatus('Close Stage', 'Opening')
return
@@ -421,6 +424,7 @@ exports.newSuperalgosBotModulesTradingStages = function (processIndex) {
/* Now we switch to the Open status. */
changeStageStatus('Manage Stage', 'Open')
announcementsModuleObject.makeAnnoucements(manageStage)
}
}
@@ -73,11 +73,11 @@ 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 Condition->' +
'Open Execution->Close Execution->' +
'Execution Algorithm->Market Buy Order->Market Sell Order->Limit Buy Order->Limit Sell Order->' +
'Order Rate->Formula->' +
'Create Order Event->Cancel Order Event->' +
'Announcement->Announcement Formula->Announcement Condition->' +
'Size In Base Asset->Size In Quoted Asset->Position Rate->Formula->' +
'Situation->Condition->Javascript Code->' +
'Market Order->Limit Order->' +