Beta 6 without Execution
This commit is contained in:
1 parent
4033d4d07f
commit
d40b985f5e
123 files changed
+8114
-12392
No files matched your search
@@ -25,7 +25,7 @@
|
||||
|
||||
// Secondary functions and properties.
|
||||
|
||||
currentRecord: undefined
|
||||
record: undefined
|
||||
};
|
||||
|
||||
/* this is part of the module template */
|
||||
@@ -374,13 +374,12 @@
|
||||
|
||||
record.begin = dailyFile[1][i][0];
|
||||
record.end = dailyFile[1][i][1];
|
||||
record.strategyNumber = dailyFile[1][i][2];
|
||||
record.strategyPhase = dailyFile[1][i][3];
|
||||
record.stopLossPhase = dailyFile[1][i][4];
|
||||
record.takeProfitPhase = dailyFile[1][i][5];
|
||||
record.conditions = dailyFile[1][i][6];
|
||||
record.formulaErrors = dailyFile[1][i][7];
|
||||
record.formulaValues = dailyFile[1][i][8];
|
||||
record.strategyIndex = dailyFile[1][i][2];
|
||||
record.variable_current_position_stopLoss_phase = dailyFile[1][i][3];
|
||||
record.variable_current_position_takeProfit_phase = dailyFile[1][i][4];
|
||||
record.conditions = dailyFile[1][i][5];
|
||||
record.formulaErrors = dailyFile[1][i][6];
|
||||
record.formulaValues = dailyFile[1][i][7];
|
||||
|
||||
if (
|
||||
(record.begin >= farLeftDate.valueOf() && record.end <= farRightDate.valueOf()) &&
|
||||
@@ -391,8 +390,8 @@
|
||||
|
||||
if (datetime.valueOf() >= record.begin && datetime.valueOf() <= record.end) {
|
||||
|
||||
thisObject.currentRecord = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Condition Changed", thisObject.currentRecord);
|
||||
thisObject.record = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Condition Changed", thisObject.record);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -446,13 +445,12 @@
|
||||
|
||||
record.begin = marketFile[1][i][0];
|
||||
record.end = marketFile[1][i][1];
|
||||
record.strategyNumber = marketFile[1][i][2];
|
||||
record.strategyPhase = marketFile[1][i][3];
|
||||
record.stopLossPhase = marketFile[1][i][4];
|
||||
record.takeProfitPhase = marketFile[1][i][5];
|
||||
record.conditions = marketFile[1][i][6];
|
||||
record.formulaErrors = marketFile[1][i][7];
|
||||
record.formulaValues = marketFile[1][i][8];
|
||||
record.strategyIndex = marketFile[1][i][2];
|
||||
record.variable_current_position_stopLoss_phase = marketFile[1][i][3];
|
||||
record.variable_current_position_takeProfit_phase = marketFile[1][i][4];
|
||||
record.conditions = marketFile[1][i][5];
|
||||
record.formulaErrors = marketFile[1][i][6];
|
||||
record.formulaValues = marketFile[1][i][7];
|
||||
|
||||
if (
|
||||
(record.begin >= leftDate.valueOf() && record.end <= rightDate.valueOf()) &&
|
||||
@@ -463,8 +461,8 @@
|
||||
|
||||
if (datetime.valueOf() >= record.begin && datetime.valueOf() <= record.end) {
|
||||
|
||||
thisObject.currentRecord = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Condition Changed", thisObject.currentRecord);
|
||||
thisObject.record = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Condition Changed", thisObject.record);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -494,18 +492,17 @@
|
||||
|
||||
if (userPositionDate >= conditionRecord.begin && userPositionDate <= conditionRecord.end) {
|
||||
|
||||
let currentRecord = {
|
||||
let record = {
|
||||
conditionsNames: headers,
|
||||
strategyNumber: conditionRecord.strategyNumber,
|
||||
strategyPhase: conditionRecord.strategyPhase,
|
||||
stopLossPhase: conditionRecord.stopLossPhase,
|
||||
takeProfitPhase: conditionRecord.takeProfitPhase,
|
||||
strategyIndex: conditionRecord.strategyIndex,
|
||||
variable_current_position_stopLoss_phase: conditionRecord.variable_current_position_stopLoss_phase,
|
||||
variable_current_position_takeProfit_phase: conditionRecord.variable_current_position_takeProfit_phase,
|
||||
conditionsValues: conditionRecord.conditions,
|
||||
formulaErrors: conditionRecord.formulaErrors,
|
||||
formulaValues: conditionRecord.formulaValues
|
||||
};
|
||||
|
||||
sendRecordInfoToDesignerSpace(currentRecord)
|
||||
sendRecordInfoToDesignerSpace(record)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,15 +512,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
function sendRecordInfoToDesignerSpace(currentRecord) {
|
||||
function sendRecordInfoToDesignerSpace(record) {
|
||||
|
||||
if (currentRecord === undefined) { return; }
|
||||
if (currentRecord.conditionsNames === undefined) { return; }
|
||||
if (record === undefined) { return; }
|
||||
if (record.conditionsNames === undefined) { return; }
|
||||
if (canvas.designSpace.workspace === undefined) { return; }
|
||||
|
||||
/* We will get now the designer trading system */
|
||||
let designerTradingSystem
|
||||
let fileTradingSystem = currentRecord.conditionsNames;
|
||||
let fileTradingSystem = record.conditionsNames;
|
||||
|
||||
for (let i = 0; i < canvas.designSpace.workspace.workspaceNode.rootNodes.length; i++) {
|
||||
let rootNode = canvas.designSpace.workspace.workspaceNode.rootNodes[i]
|
||||
@@ -568,7 +565,7 @@
|
||||
let strategy = fileTradingSystem.strategies[j];
|
||||
designerTradingSystem.strategies[j].payload.uiObject.setErrorMessage(strategy.error)
|
||||
|
||||
if (currentRecord.strategyNumber === j) {
|
||||
if (record.strategyIndex === j) {
|
||||
designerTradingSystem.strategies[j].payload.uiObject.isExecuting = true
|
||||
} else {
|
||||
designerTradingSystem.strategies[j].payload.uiObject.isExecuting = false
|
||||
@@ -653,7 +650,7 @@
|
||||
|
||||
for (let p = 0; p < initialDefinition.stopLoss.phases.length; p++) {
|
||||
|
||||
if (currentRecord.strategyNumber === j && currentRecord.stopLossPhase === p) {
|
||||
if (record.strategyIndex === j && record.variable_current_position_stopLoss_phase === p) {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.stopLoss.phases[p].payload.uiObject.isExecuting = true
|
||||
} else {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.stopLoss.phases[p].payload.uiObject.isExecuting = false
|
||||
@@ -665,15 +662,15 @@
|
||||
if (phase.formula !== undefined) {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.stopLoss.phases[p].formula.payload.uiObject.setErrorMessage(openStage.initialDefinition.stopLoss.phases[p].formula.error)
|
||||
|
||||
if (currentRecord.formulaErrors[formulaErrorsIndex] !== "") {
|
||||
if (currentRecord.strategyNumber === j && currentRecord.stopLossPhase === p) {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.stopLoss.phases[p].formula.payload.uiObject.setErrorMessage(currentRecord.formulaErrors[formulaErrorsIndex])
|
||||
if (record.formulaErrors[formulaErrorsIndex] !== "") {
|
||||
if (record.strategyIndex === j && record.variable_current_position_stopLoss_phase === p) {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.stopLoss.phases[p].formula.payload.uiObject.setErrorMessage(record.formulaErrors[formulaErrorsIndex])
|
||||
}
|
||||
}
|
||||
formulaErrorsIndex++
|
||||
|
||||
if (currentRecord.strategyNumber === j && currentRecord.stopLossPhase === p) {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.stopLoss.phases[p].formula.payload.uiObject.setValue(currentRecord.formulaValues[formulaValuesIndex])
|
||||
if (record.strategyIndex === j && record.variable_current_position_stopLoss_phase === p) {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.stopLoss.phases[p].formula.payload.uiObject.setValue(record.formulaValues[formulaValuesIndex])
|
||||
}
|
||||
formulaValuesIndex++
|
||||
}
|
||||
@@ -738,7 +735,7 @@
|
||||
|
||||
for (let p = 0; p < initialDefinition.takeProfit.phases.length; p++) {
|
||||
|
||||
if (currentRecord.strategyNumber === j && currentRecord.takeProfitPhase === p) {
|
||||
if (record.strategyIndex === j && record.variable_current_position_takeProfit_phase === p) {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.takeProfit.phases[p].payload.uiObject.isExecuting = true
|
||||
} else {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.takeProfit.phases[p].payload.uiObject.isExecuting = false
|
||||
@@ -750,15 +747,15 @@
|
||||
if (phase.formula !== undefined) {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.takeProfit.phases[p].formula.payload.uiObject.setErrorMessage(openStage.initialDefinition.takeProfit.phases[p].formula.error)
|
||||
|
||||
if (currentRecord.formulaErrors[formulaErrorsIndex] !== "") {
|
||||
if (currentRecord.strategyNumber === j && currentRecord.takeProfitPhase === p) {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.takeProfit.phases[p].formula.payload.uiObject.setErrorMessage(currentRecord.formulaErrors[formulaErrorsIndex])
|
||||
if (record.formulaErrors[formulaErrorsIndex] !== "") {
|
||||
if (record.strategyIndex === j && record.variable_current_position_takeProfit_phase === p) {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.takeProfit.phases[p].formula.payload.uiObject.setErrorMessage(record.formulaErrors[formulaErrorsIndex])
|
||||
}
|
||||
}
|
||||
formulaErrorsIndex++
|
||||
|
||||
if (currentRecord.strategyNumber === j && currentRecord.takeProfitPhase === p) {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.takeProfit.phases[p].formula.payload.uiObject.setValue(currentRecord.formulaValues[formulaValuesIndex])
|
||||
if (record.strategyIndex === j && record.variable_current_position_takeProfit_phase === p) {
|
||||
designerTradingSystem.strategies[j].openStage.initialDefinition.takeProfit.phases[p].formula.payload.uiObject.setValue(record.formulaValues[formulaValuesIndex])
|
||||
}
|
||||
formulaValuesIndex++
|
||||
}
|
||||
@@ -836,7 +833,7 @@
|
||||
|
||||
for (let p = 0; p < manageStage.stopLoss.phases.length; p++) {
|
||||
|
||||
if (currentRecord.strategyNumber === j && currentRecord.stopLossPhase - 1 === p) {
|
||||
if (record.strategyIndex === j && record.variable_current_position_stopLoss_phase - 1 === p) {
|
||||
designerTradingSystem.strategies[j].manageStage.stopLoss.phases[p].payload.uiObject.isExecuting = true
|
||||
} else {
|
||||
designerTradingSystem.strategies[j].manageStage.stopLoss.phases[p].payload.uiObject.isExecuting = false
|
||||
@@ -848,14 +845,14 @@
|
||||
if (phase.formula !== undefined) {
|
||||
designerTradingSystem.strategies[j].manageStage.stopLoss.phases[p].formula.payload.uiObject.setErrorMessage(manageStage.stopLoss.phases[p].formula.error)
|
||||
|
||||
if (currentRecord.formulaErrors[formulaErrorsIndex] !== "") {
|
||||
if (currentRecord.strategyNumber === j && currentRecord.stopLossPhase - 1 === p) {
|
||||
designerTradingSystem.strategies[j].manageStage.stopLoss.phases[p].formula.payload.uiObject.setErrorMessage(currentRecord.formulaErrors[formulaErrorsIndex])
|
||||
if (record.formulaErrors[formulaErrorsIndex] !== "") {
|
||||
if (record.strategyIndex === j && record.variable_current_position_stopLoss_phase - 1 === p) {
|
||||
designerTradingSystem.strategies[j].manageStage.stopLoss.phases[p].formula.payload.uiObject.setErrorMessage(record.formulaErrors[formulaErrorsIndex])
|
||||
}
|
||||
}
|
||||
formulaErrorsIndex++
|
||||
if (currentRecord.strategyNumber === j && currentRecord.stopLossPhase - 1 === p) {
|
||||
designerTradingSystem.strategies[j].manageStage.stopLoss.phases[p].formula.payload.uiObject.setValue(currentRecord.formulaValues[formulaValuesIndex])
|
||||
if (record.strategyIndex === j && record.variable_current_position_stopLoss_phase - 1 === p) {
|
||||
designerTradingSystem.strategies[j].manageStage.stopLoss.phases[p].formula.payload.uiObject.setValue(record.formulaValues[formulaValuesIndex])
|
||||
}
|
||||
formulaValuesIndex++
|
||||
}
|
||||
@@ -920,7 +917,7 @@
|
||||
|
||||
for (let p = 0; p < manageStage.takeProfit.phases.length; p++) {
|
||||
|
||||
if (currentRecord.strategyNumber === j && currentRecord.takeProfitPhase - 1 === p) {
|
||||
if (record.strategyIndex === j && record.variable_current_position_takeProfit_phase - 1 === p) {
|
||||
designerTradingSystem.strategies[j].manageStage.takeProfit.phases[p].payload.uiObject.isExecuting = true
|
||||
} else {
|
||||
designerTradingSystem.strategies[j].manageStage.takeProfit.phases[p].payload.uiObject.isExecuting = false
|
||||
@@ -932,15 +929,15 @@
|
||||
if (phase.formula !== undefined) {
|
||||
designerTradingSystem.strategies[j].manageStage.takeProfit.phases[p].formula.payload.uiObject.setErrorMessage(manageStage.takeProfit.phases[p].formula.error)
|
||||
|
||||
if (currentRecord.formulaErrors[formulaErrorsIndex] !== "") {
|
||||
if (currentRecord.strategyNumber === j && currentRecord.takeProfitPhase - 1 === p) {
|
||||
designerTradingSystem.strategies[j].manageStage.takeProfit.phases[p].formula.payload.uiObject.setErrorMessage(currentRecord.formulaErrors[formulaErrorsIndex])
|
||||
if (record.formulaErrors[formulaErrorsIndex] !== "") {
|
||||
if (record.strategyIndex === j && record.variable_current_position_takeProfit_phase - 1 === p) {
|
||||
designerTradingSystem.strategies[j].manageStage.takeProfit.phases[p].formula.payload.uiObject.setErrorMessage(record.formulaErrors[formulaErrorsIndex])
|
||||
}
|
||||
}
|
||||
formulaErrorsIndex++
|
||||
|
||||
if (currentRecord.strategyNumber === j && currentRecord.takeProfitPhase - 1 === p) {
|
||||
designerTradingSystem.strategies[j].manageStage.takeProfit.phases[p].formula.payload.uiObject.setValue(currentRecord.formulaValues[formulaValuesIndex])
|
||||
if (record.strategyIndex === j && record.variable_current_position_takeProfit_phase - 1 === p) {
|
||||
designerTradingSystem.strategies[j].manageStage.takeProfit.phases[p].formula.payload.uiObject.setValue(record.formulaValues[formulaValuesIndex])
|
||||
}
|
||||
formulaValuesIndex++
|
||||
}
|
||||
@@ -1032,7 +1029,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (currentRecord.conditionsValues[conditionIndex] === 1) {
|
||||
if (record.conditionsValues[conditionIndex] === 1) {
|
||||
condition.payload.uiObject.highlight()
|
||||
} else {
|
||||
highlightSituation = false
|
||||
|
||||
Reference in new issue
Block a user