genereteUniqueId function moved to SA
This commit is contained in:
1 parent
40c7307086
commit
d29335489f
11 files changed
+37
-19
No files matched your search
@@ -12,3 +12,4 @@ Projects/Foundations/Icons/Thumbs.db
|
||||
*.exe
|
||||
node_modules
|
||||
launch.json
|
||||
.idea
|
||||
@@ -51,7 +51,7 @@ exports.newDesktopApp = function newDesktopApp() {
|
||||
Test Following Profiles.
|
||||
*/
|
||||
let eventMessage = {
|
||||
eventId: i,
|
||||
eventId: SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId(),
|
||||
eventType: SA.projects.socialTrading.globals.eventTypes.FOLLOW_USER_PROFILE,
|
||||
emitterUserProfileId: DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID,
|
||||
targetUserProfileId: profile.userProfileId
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
exports.newFoundationsUtilitiesMiscellaneousFunctions = function () {
|
||||
|
||||
let thisObject = {
|
||||
genereteUniqueId: genereteUniqueId
|
||||
}
|
||||
|
||||
return thisObject
|
||||
|
||||
function genereteUniqueId() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8)
|
||||
return v.toString(16)
|
||||
})
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -58,7 +58,7 @@ exports.newFoundationsBotModulesLearningEpisode = function (processIndex) {
|
||||
/* Recording the opening at the Learning Engine Data Structure */
|
||||
learningEngine.learningCurrent.learningEpisode.status.value = 'Open'
|
||||
learningEngine.learningCurrent.learningEpisode.serialNumber.value = 1
|
||||
learningEngine.learningCurrent.learningEpisode.identifier.value = TS.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId()
|
||||
learningEngine.learningCurrent.learningEpisode.identifier.value = SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId()
|
||||
learningEngine.learningCurrent.learningEpisode.beginRate.value = learningEngine.learningCurrent.learningEpisode.candle.close.value
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ exports.newFoundationsBotModulesTradingEpisode = function (processIndex) {
|
||||
/* Recording the opening at the Trading Engine Data Structure */
|
||||
tradingEngine.tradingCurrent.tradingEpisode.status.value = 'Open'
|
||||
tradingEngine.tradingCurrent.tradingEpisode.serialNumber.value = 1
|
||||
tradingEngine.tradingCurrent.tradingEpisode.identifier.value = TS.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId()
|
||||
tradingEngine.tradingCurrent.tradingEpisode.identifier.value = SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId()
|
||||
tradingEngine.tradingCurrent.tradingEpisode.beginRate.value = tradingEngine.tradingCurrent.tradingEpisode.candle.close.value
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -361,7 +361,7 @@ exports.newFoundationsBotModulesTradingOrders = function (processIndex) {
|
||||
|
||||
/* Create Order Procedure */
|
||||
tradingEngineOrder.status.value = 'Open'
|
||||
tradingEngineOrder.identifier.value = TS.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId()
|
||||
tradingEngineOrder.identifier.value = SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId()
|
||||
tradingEngineOrder.begin.value = tradingEngine.tradingCurrent.tradingEpisode.cycle.begin.value
|
||||
tradingEngineOrder.end.value = tradingEngine.tradingCurrent.tradingEpisode.cycle.end.value
|
||||
tradingEngineOrder.serialNumber.value = tradingEngine.tradingCurrent.tradingEpisode.tradingEpisodeCounters.orders.value
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ exports.newFoundationsBotModulesTradingPosition = function (processIndex) {
|
||||
/* Recording the opening at the Trading Engine Data Structure */
|
||||
tradingEngine.tradingCurrent.position.status.value = 'Open'
|
||||
tradingEngine.tradingCurrent.position.serialNumber.value = tradingEngine.tradingCurrent.tradingEpisode.tradingEpisodeCounters.positions.value + 1
|
||||
tradingEngine.tradingCurrent.position.identifier.value = TS.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId()
|
||||
tradingEngine.tradingCurrent.position.identifier.value = SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId()
|
||||
tradingEngine.tradingCurrent.position.beginRate.value = tradingEngine.tradingCurrent.tradingEpisode.candle.close.value
|
||||
tradingEngine.tradingCurrent.position.positionBaseAsset.beginBalance.value = tradingEngine.tradingCurrent.tradingEpisode.episodeBaseAsset.balance.value
|
||||
tradingEngine.tradingCurrent.position.positionQuotedAsset.beginBalance.value = tradingEngine.tradingCurrent.tradingEpisode.episodeQuotedAsset.balance.value
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ exports.newFoundationsBotModulesTradingStrategy = function (processIndex) {
|
||||
/* Recording the opening at the Trading Engine Data Structure */
|
||||
tradingEngine.tradingCurrent.strategy.status.value = 'Open'
|
||||
tradingEngine.tradingCurrent.strategy.serialNumber.value = tradingEngine.tradingCurrent.tradingEpisode.tradingEpisodeCounters.strategies.value
|
||||
tradingEngine.tradingCurrent.strategy.identifier.value = TS.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId()
|
||||
tradingEngine.tradingCurrent.strategy.identifier.value = SA.projects.foundations.utilities.miscellaneousFunctions.genereteUniqueId()
|
||||
tradingEngine.tradingCurrent.strategy.beginRate.value = tradingEngine.tradingCurrent.tradingEpisode.candle.min.value
|
||||
|
||||
tradingEngine.tradingCurrent.strategy.index.value = index
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
exports.newFoundationsUtilitiesMiscellaneousFunctions = function () {
|
||||
|
||||
let thisObject = {
|
||||
genereteUniqueId: genereteUniqueId,
|
||||
truncateToThisPrecision: truncateToThisPrecision,
|
||||
pad: pad,
|
||||
asyncGetDatasetFile: asyncGetDatasetFile,
|
||||
@@ -10,13 +9,6 @@ exports.newFoundationsUtilitiesMiscellaneousFunctions = function () {
|
||||
|
||||
return thisObject
|
||||
|
||||
function genereteUniqueId() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8)
|
||||
return v.toString(16)
|
||||
})
|
||||
}
|
||||
|
||||
function truncateToThisPrecision(floatNumber, precision) {
|
||||
return parseFloat(floatNumber.toFixed(precision))
|
||||
}
|
||||
|
||||
@@ -894,6 +894,12 @@
|
||||
"propertyName": "plugins",
|
||||
"functionName": "newFoundationsUtilitiesPlugins",
|
||||
"fileName": "Plugins.js"
|
||||
},
|
||||
{
|
||||
"name": "Miscellaneous Functions",
|
||||
"propertyName": "miscellaneousFunctions",
|
||||
"functionName": "newFoundationsUtilitiesMiscellaneousFunctions",
|
||||
"fileName": "MiscellaneousFunctions.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -123,7 +123,7 @@ exports.newSocialTradingModulesClientInterface = function newSocialTradingModule
|
||||
|
||||
let response = {
|
||||
result: 'Ok',
|
||||
message: 'Client Interface Event Processed.'
|
||||
message: 'Client Interface Event Processed.'
|
||||
}
|
||||
return response
|
||||
|
||||
@@ -132,9 +132,11 @@ exports.newSocialTradingModulesClientInterface = function newSocialTradingModule
|
||||
Any exception that happens while trying to change the state of the Social Graph,
|
||||
will be returned to the caller without doing anything else here.
|
||||
*/
|
||||
let errorMessage = err.message
|
||||
if (errorMessage === undefined) { errorMessage = err }
|
||||
let response = {
|
||||
result: 'Error',
|
||||
message: 'Client Interface ' + err.message
|
||||
message: 'Client Interface ' + errorMessage
|
||||
}
|
||||
return response
|
||||
}
|
||||
@@ -191,21 +193,23 @@ exports.newSocialTradingModulesClientInterface = function newSocialTradingModule
|
||||
try {
|
||||
let query = NT.projects.socialTrading.modules.query.newSocialTradingModulesQuery()
|
||||
query.initialize(queryReceived)
|
||||
|
||||
|
||||
let response = {
|
||||
result: 'Ok',
|
||||
message: 'Client Interface Query Processed.',
|
||||
data: query.execute()
|
||||
}
|
||||
return response
|
||||
|
||||
|
||||
} catch (err) {
|
||||
/*
|
||||
Any exception that happens while trying to execute the query.
|
||||
*/
|
||||
let errorMessage = err.message
|
||||
if (errorMessage === undefined) { errorMessage = err }
|
||||
let response = {
|
||||
result: 'Error',
|
||||
message: err.message
|
||||
message: 'Client Interface ' + errorMessage
|
||||
}
|
||||
return response
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user