Beta 6 without Execution

This commit is contained in:
Luis Fernando Molina committed 2020-07-06 15:43:34 +02:00
1 parent 4033d4d07f
commit d40b985f5e
123 files changed
+8114 -12392

No files matched your search

@@ -6,7 +6,7 @@ function newSessionFunctions () {
return thisObject
function runSession (node, functionLibraryProtocolNode, functionLibraryDependenciesFilter, callBackFunction) {
function runSession (node, functionLibraryProtocolNode, functionLibraryDependenciesFilter, resume, callBackFunction) {
if (validations(node) !== true) {
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
return
@@ -24,37 +24,66 @@ function newSessionFunctions () {
'Parameters->' +
'Base Asset->Quoted Asset->Time Range->Time Frame->Slippage->Fee Structure->' +
'Exchange Account Asset->Asset->' +
'Strategy->' +
'Trading Strategy->' +
'Trigger Stage->Trigger On Event->Trigger Off Event->Take Position Event->' +
'Announcement->Formula->' +
'Open Stage->Initial Definition->Open Execution->' +
'Position Size->Position Rate->Formula->' +
'Initial Stop->Initial Take Profit->' +
'Manage Stage->' +
'Stop->Take Profit->' +
'Phase->Formula->Next Phase Event->Move to Phase Event->Phase->' +
'Managed Stop Loss->Managed Take Profit->' +
'Phase->Formula->Next Phase Event->Move To Phase Event->Phase->' +
'Situation->Condition->Javascript Code->' +
'Close Stage->Close Execution->' +
'Announcement->Formula->'
let tradingSystem = functionLibraryProtocolNode.getProtocolNode(node.payload.referenceParent, false, true, true, false, false, lightingPath)
let tradingSystem = functionLibraryProtocolNode.getProtocolNode(node.tradingSystemReference.payload.referenceParent, false, true, true, false, false, lightingPath)
lightingPath = '' +
'Trading Engine->' +
'Dynamic Indicators->Indicator Function->Formula->' +
'Episode->Current->Last->Previous->' +
'Episode Counters->Episode Statistics->' +
'Periods->Positions->Hits->Fails->' +
'Profit Loss->Hit Ratio->Days->ROI->Anualized Rate Of Return->User Defined Statistic->' +
'Formula->' +
'Candle->' +
'Begin->End->Open->Close->Min->Max->Index->' +
'Balance->Base Asset->Quoted Asset->' +
'Distance To Event->' +
'Trigger On->Trigger Off->Take Position->Close Position->Next Phase->Move To Phase->' +
'Strategy->' +
'Begin->End->Strategy Name->Index->Stage Type->Status->Begin Rate->End Rate->Situation Name->' +
'Strategy Counters->Periods->' +
'Position->' +
'Begin->End->Rate->Size->Exit Type->Status->Begin Rate->End Rate->Situation Name->' +
'Stop Loss->Stop Loss Stage->Stop Loss Phase->' +
'Take Profit->Take Profit Stage->Take Profit Phase->' +
'Position Counters->Periods->' +
'Position Statistics->Profit Loss->Days->ROI->Hit Fail->User Defined Statistic->' +
'Formula'
let tradingEngine = functionLibraryProtocolNode.getProtocolNode(node.tradingEngineReference.payload.referenceParent, false, true, true, false, false, lightingPath)
lightingPath = '' +
'Backtesting Session->Paper Trading Session->Fordward Testing Session->Live Trading Session->' +
'Parameters->' +
'Base Asset->Quoted Asset->Time Range->Time Frame->Slippage->Fee Structure->' +
'Session Base Asset->Session Quoted Asset->Time Range->Time Frame->Slippage->Fee Structure->Snapshots->User Defined Parameters->' +
'Exchange Account Asset->Asset->' +
'Social Bots->Telegram Bot->'
let session = functionLibraryProtocolNode.getProtocolNode(node, false, true, true, false, false, lightingPath)
let dependencyFilter = functionLibraryDependenciesFilter.createFilter(node.payload.referenceParent)
let dependencyFilter = functionLibraryDependenciesFilter.createFilter(node.tradingSystemReference.payload.referenceParent)
/* Raise event to run the session */
let event = {
appSchema: JSON.stringify(APP_SCHEMA_ARRAY),
session: JSON.stringify(session),
tradingSystem: JSON.stringify(tradingSystem),
dependencyFilter: JSON.stringify(dependencyFilter)
tradingEngine: JSON.stringify(tradingEngine),
dependencyFilter: JSON.stringify(dependencyFilter),
resume: resume
}
eventsServerClient.raiseEvent(key, 'Run Session', event)
@@ -121,8 +150,23 @@ function newSessionFunctions () {
return
}
if (node.payload.referenceParent === undefined) {
node.payload.uiObject.setErrorMessage('Session needs to reference a Trading System.')
if (node.tradingSystemReference === undefined) {
node.payload.uiObject.setErrorMessage('Session needs a child Trading System Reference.')
return
}
if (node.tradingEngineReference === undefined) {
node.payload.uiObject.setErrorMessage('Session needs a child Trading Engine Reference.')
return
}
if (node.tradingSystemReference.payload.referenceParent === undefined) {
node.payload.uiObject.setErrorMessage('Trading System Reference needs to reference a Trading System.')
return
}
if (node.tradingEngineReference.payload.referenceParent === undefined) {
node.payload.uiObject.setErrorMessage('Trading Engine Reference needs to reference a Trading Engine.')
return
}
return true