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
|
||||
|
||||
@@ -1,348 +0,0 @@
|
||||
function newAAMastersPlottersTradingSimulationFinalResults() {
|
||||
|
||||
const MODULE_NAME = "Final Results Plotter";
|
||||
const ERROR_LOG = true;
|
||||
const INTENSIVE_LOG = false;
|
||||
const logger = newWebDebugLog();
|
||||
logger.fileName = MODULE_NAME;
|
||||
|
||||
let thisObject = {
|
||||
|
||||
// Main functions and properties.
|
||||
|
||||
initialize: initialize,
|
||||
finalize: finalize,
|
||||
container: undefined,
|
||||
getContainer: getContainer,
|
||||
setTimePeriod: setTimePeriod,
|
||||
setDatetime: setDatetime,
|
||||
draw: draw,
|
||||
recalculateScale: recalculateScale,
|
||||
currentRecord: undefined
|
||||
};
|
||||
|
||||
/* this is part of the module template */
|
||||
|
||||
let container = newContainer(); // Do not touch this 3 lines, they are just needed.
|
||||
container.initialize();
|
||||
thisObject.container = container;
|
||||
|
||||
let timeLineCoordinateSystem = newTimeLineCoordinateSystem(); // Needed to be able to plot on the timeline, otherwise not.
|
||||
|
||||
let timePeriod; // This will hold the current Time Period the user is at.
|
||||
let datetime; // This will hold the current Datetime the user is at.
|
||||
|
||||
let dataFile; // This is the current Market File being plotted.
|
||||
let fileCursor; // This is the current File Cursor being used to retrieve Daily Files.
|
||||
|
||||
let singleFile; // This object will provide the different Market Files at different Time Periods.
|
||||
|
||||
/* these are module specific variables: */
|
||||
|
||||
let records = []; // Here we keep the records to be ploted every time the Draw() function is called by the AAWebPlatform.
|
||||
|
||||
let imageStopLossPhase;
|
||||
let imageTakeProfitPhase;
|
||||
let imageRecord;
|
||||
|
||||
let zoomChangedEventSubscriptionId
|
||||
let offsetChangedEventSubscriptionId
|
||||
let filesUpdatedEventSubscriptionId
|
||||
let dragFinishedEventSubscriptionId
|
||||
let dimmensionsChangedEventSubscriptionId
|
||||
|
||||
return thisObject;
|
||||
|
||||
function finalize() {
|
||||
try {
|
||||
|
||||
/* Stop listening to the necesary events. */
|
||||
|
||||
viewPort.eventHandler.stopListening(zoomChangedEventSubscriptionId);
|
||||
viewPort.eventHandler.stopListening(offsetChangedEventSubscriptionId);
|
||||
singleFile.eventHandler.stopListening(filesUpdatedEventSubscriptionId);
|
||||
canvas.eventHandler.stopListening(dragFinishedEventSubscriptionId);
|
||||
thisObject.container.eventHandler.stopListening(dimmensionsChangedEventSubscriptionId)
|
||||
|
||||
/* icons */
|
||||
|
||||
imageStopLossPhase = undefined;
|
||||
imageTakeProfitPhase = undefined;
|
||||
imageRecord = undefined;
|
||||
|
||||
/* Destroy References */
|
||||
|
||||
singleFile = undefined;
|
||||
|
||||
datetime = undefined;
|
||||
timePeriod = undefined;
|
||||
|
||||
dataFile = undefined;
|
||||
fileCursor = undefined;
|
||||
|
||||
} catch (err) {
|
||||
|
||||
if (ERROR_LOG === true) { logger.write("[ERROR] finalize -> err = " + err.stack); }
|
||||
}
|
||||
}
|
||||
|
||||
function initialize(pStorage, pExchange, pMarket, pDatetime, pTimePeriod, callBackFunction) {
|
||||
|
||||
try {
|
||||
|
||||
/* Store the information received. */
|
||||
|
||||
singleFile = pStorage.singleFile;
|
||||
|
||||
datetime = pDatetime;
|
||||
timePeriod = pTimePeriod;
|
||||
|
||||
dataFile = singleFile.getFile(timePeriod);
|
||||
|
||||
/* Listen to the necesary events. */
|
||||
|
||||
zoomChangedEventSubscriptionId = viewPort.eventHandler.listenToEvent("Zoom Changed", onZoomChanged);
|
||||
offsetChangedEventSubscriptionId = viewPort.eventHandler.listenToEvent("Offset Changed", onOffsetChanged);
|
||||
filesUpdatedEventSubscriptionId = singleFile.eventHandler.listenToEvent("Files Updated", onFilesUpdated);
|
||||
dragFinishedEventSubscriptionId = canvas.eventHandler.listenToEvent("Drag Finished", onDragFinished);
|
||||
|
||||
/* Get ready for plotting. */
|
||||
|
||||
recalculate();
|
||||
|
||||
/* Ready for when dimmension changes. */
|
||||
|
||||
dimmensionsChangedEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('Dimmensions Changed', function () {
|
||||
recalculate();
|
||||
})
|
||||
|
||||
callBackFunction();
|
||||
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write("[ERROR] initialize -> err = " + err.stack); }
|
||||
}
|
||||
}
|
||||
|
||||
function getContainer(point) {
|
||||
let container;
|
||||
/* First we check if this point is inside this space. */
|
||||
if (this.container.frame.isThisPointHere(point) === true) {
|
||||
return this.container;
|
||||
} else {
|
||||
/* This point does not belong to this space. */
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
function onFilesUpdated() {
|
||||
try {
|
||||
dataFile = singleFile.getFile(timePeriod);
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write("[ERROR] onFilesUpdated -> err = " + err.stack); }
|
||||
}
|
||||
}
|
||||
|
||||
function setTimePeriod(pTimePeriod) {
|
||||
try {
|
||||
if (timePeriod !== pTimePeriod) {
|
||||
timePeriod = pTimePeriod;
|
||||
dataFile = singleFile.getFile(timePeriod);
|
||||
recalculate();
|
||||
}
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write("[ERROR] setTimePeriod -> err = " + err.stack); }
|
||||
}
|
||||
}
|
||||
|
||||
function setDatetime(pDatetime) {
|
||||
datetime = pDatetime;
|
||||
}
|
||||
|
||||
function draw() {
|
||||
try {
|
||||
// Nothing to draw for now
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write("[ERROR] draw -> err = " + err.stack); }
|
||||
}
|
||||
}
|
||||
|
||||
function recalculate() {
|
||||
|
||||
try {
|
||||
|
||||
records = []
|
||||
|
||||
if (timePeriod >= _1_HOUR_IN_MILISECONDS) {
|
||||
|
||||
recalculateUsingMarketFiles();
|
||||
|
||||
} else {
|
||||
|
||||
recalculateUsingDailyFiles();
|
||||
|
||||
}
|
||||
|
||||
thisObject.container.eventHandler.raiseEvent("Records Changed", records);
|
||||
|
||||
} catch (err) {
|
||||
|
||||
if (ERROR_LOG === true) { logger.write("[ERROR] recalculate -> err = " + err.stack); }
|
||||
}
|
||||
}
|
||||
|
||||
function recalculate() {
|
||||
|
||||
try {
|
||||
|
||||
if (dataFile === undefined) { return; } // Initialization not complete yet.
|
||||
|
||||
records = [];
|
||||
|
||||
for (let i = 0; i < dataFile.length; i++) {
|
||||
|
||||
let record = {};
|
||||
|
||||
record.begin = dataFile[i][0];
|
||||
record.end = dataFile[i][1];
|
||||
record.type = dataFile[i][2];
|
||||
record.rate = dataFile[i][3];
|
||||
record.amount = dataFile[i][4];
|
||||
record.balanceA = dataFile[i][5];
|
||||
record.balanceB = dataFile[i][6];
|
||||
record.profit = dataFile[i][7];
|
||||
record.lastTradeProfitLoss = dataFile[i][8];
|
||||
record.stopLoss = dataFile[i][9];
|
||||
record.roundtrips = dataFile[i][10];
|
||||
record.hits = dataFile[i][11];
|
||||
record.fails = dataFile[i][12];
|
||||
record.hitRatio = dataFile[i][13];
|
||||
record.ROI = dataFile[i][14];
|
||||
record.periods = dataFile[i][15];
|
||||
record.days = dataFile[i][16];
|
||||
record.anualizedRateOfReturn = dataFile[i][17];
|
||||
record.sellRate = dataFile[i][18];
|
||||
record.lastTradeROI = dataFile[i][19];
|
||||
record.strategy = dataFile[i][20];
|
||||
record.strategyPhase = dataFile[i][21];
|
||||
record.takeProfit = dataFile[i][22];
|
||||
record.stopLossPhase = dataFile[i][23];
|
||||
record.takeProfitPhase = dataFile[i][24];
|
||||
record.positionSize = dataFile[i][26]; // 25 is the message for the executor
|
||||
record.initialBalanceA = dataFile[i][27];
|
||||
record.minimunBalanceA = dataFile[i][28];
|
||||
record.maximunBalanceA = dataFile[i][29];
|
||||
record.initialBalanceB = dataFile[i][30];
|
||||
record.minimunBalanceB = dataFile[i][31];
|
||||
record.maximunBalanceB = dataFile[i][32];
|
||||
record.baseAsset = dataFile[i][33];
|
||||
record.positionPeriods = dataFile[i][34];
|
||||
record.positionDays = dataFile[i][35];
|
||||
|
||||
thisObject.currentRecord = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Record Changed", thisObject.currentRecord);
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write("[ERROR] recalculate -> err = " + err.stack); }
|
||||
}
|
||||
}
|
||||
|
||||
function recalculateScale() {
|
||||
try {
|
||||
// No scale needed
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write("[ERROR] recalculateScale -> err = " + err.stack); }
|
||||
}
|
||||
}
|
||||
|
||||
function plotChart() {
|
||||
try {
|
||||
let userPosition = getUserPosition()
|
||||
let userPositionDate = userPosition.point.x
|
||||
|
||||
let record;
|
||||
|
||||
/* Now we calculate and plot the records */
|
||||
for (let i = 0; i < records.length; i++) { // We do not start in 0 so as to be able to read the previous record i - 1
|
||||
|
||||
record = records[i];
|
||||
|
||||
/* Send the current record to the panel */
|
||||
|
||||
if (userPositionDate >= record.begin && userPositionDate <= record.end) {
|
||||
|
||||
let eventRecords = {
|
||||
currentRecord: record,
|
||||
lastRecord: records[records.length - 1]
|
||||
};
|
||||
thisObject.container.eventHandler.raiseEvent("Current Record Changed", eventRecords);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write("[ERROR] plotChart -> err = " + err.stack); }
|
||||
}
|
||||
}
|
||||
|
||||
function onZoomChanged(event) {
|
||||
try {
|
||||
recalculate();
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write("[ERROR] onZoomChanged -> err = " + err.stack); }
|
||||
}
|
||||
}
|
||||
|
||||
function onOffsetChanged() {
|
||||
try {
|
||||
if (Math.random() * 100 > 95) {
|
||||
recalculate()
|
||||
};
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write("[ERROR] onOffsetChanged -> err = " + err.stack); }
|
||||
}
|
||||
}
|
||||
|
||||
function onDragFinished() {
|
||||
try {
|
||||
recalculate();
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write("[ERROR] onDragFinished -> err = " + err.stack); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,360 +0,0 @@
|
||||
|
||||
function newAAMastersPlottersTradingSimulationTradingSimulationFinalResultsPanel() {
|
||||
|
||||
let thisObject = {
|
||||
fitFunction: undefined,
|
||||
onEventRaised: onEventRaised,
|
||||
container: undefined,
|
||||
draw: draw,
|
||||
getContainer: getContainer,
|
||||
initialize: initialize,
|
||||
finalize: finalize
|
||||
};
|
||||
|
||||
let container = newContainer();
|
||||
container.initialize();
|
||||
thisObject.container = container;
|
||||
|
||||
container.displacement.containerName = "Final Results";
|
||||
container.frame.containerName = "Final Results";
|
||||
|
||||
let currentRecord;
|
||||
let lastRecord;
|
||||
let panelTabButton
|
||||
|
||||
|
||||
return thisObject;
|
||||
|
||||
function initialize() {
|
||||
|
||||
thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL * 2;
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.NORMAL * 2.5;
|
||||
|
||||
thisObject.container.frame.position.x = viewPort.visibleArea.topLeft.x + thisObject.container.frame.width * 1;
|
||||
thisObject.container.frame.position.y = viewPort.visibleArea.topRight.y;
|
||||
|
||||
panelTabButton = newPanelTabButton()
|
||||
panelTabButton.parentContainer = thisObject.container
|
||||
panelTabButton.container.frame.parentFrame = thisObject.container.frame
|
||||
panelTabButton.fitFunction = thisObject.fitFunction
|
||||
panelTabButton.initialize()
|
||||
|
||||
}
|
||||
|
||||
function finalize() {
|
||||
|
||||
}
|
||||
|
||||
function getContainer(point) {
|
||||
|
||||
let container;
|
||||
|
||||
container = panelTabButton.getContainer(point)
|
||||
if (container !== undefined) { return container }
|
||||
|
||||
if (thisObject.container.frame.isThisPointHere(point, true) === true) {
|
||||
|
||||
let checkPoint = {
|
||||
x: point.x,
|
||||
y: point.y
|
||||
}
|
||||
|
||||
checkPoint = thisObject.fitFunction(checkPoint)
|
||||
|
||||
if (point.x === checkPoint.x && point.y === checkPoint.y) {
|
||||
return thisObject.container;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function onEventRaised(records) {
|
||||
|
||||
currentRecord = records.currentRecord;
|
||||
lastRecord = records.lastRecord
|
||||
|
||||
}
|
||||
|
||||
|
||||
function draw() {
|
||||
|
||||
thisObject.container.frame.draw(false, false, true, thisObject.fitFunction);
|
||||
|
||||
plotCurrentRecordInfo();
|
||||
|
||||
panelTabButton.draw()
|
||||
}
|
||||
|
||||
|
||||
function plotCurrentRecordInfo() {
|
||||
|
||||
if (currentRecord === undefined) { return; }
|
||||
if (lastRecord === undefined) { return; }
|
||||
|
||||
const frameBodyHeight = thisObject.container.frame.getBodyHeight();
|
||||
const frameTitleHeight = thisObject.container.frame.height - frameBodyHeight;
|
||||
|
||||
const X_AXIS = thisObject.container.frame.width / 2;
|
||||
const Y_AXIS = frameTitleHeight + frameBodyHeight / 2;
|
||||
|
||||
|
||||
/* put the labels with the records values */
|
||||
|
||||
browserCanvasContext.beginPath();
|
||||
|
||||
let y = 0;
|
||||
let increment = 0.024;
|
||||
|
||||
y = y + increment;
|
||||
y = y + increment;
|
||||
printLabel('Current Position', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Size', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.positionSize, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Rate', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.sellRate, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Stop', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.stopLoss, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Take Profit', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.takeProfit, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Periods', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.positionPeriods), X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Days', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.positionDays).toFixed(2), X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
y = y + increment;
|
||||
printLabel('Latest Position', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Profit / Loss', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.lastTradeProfitLoss), X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('ROI', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.lastTradeROI).toFixed(2) + ' % ', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
|
||||
|
||||
let bifurcationLevel = y
|
||||
y = y + increment;
|
||||
y = y + increment;
|
||||
printLabel('Partial Results', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Profit / Loss', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.profit, X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Trades', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.roundtrips, X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Hits', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.hits, X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Fails', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.fails, X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Hit Ratio', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.hitRatio * 100).toFixed(2) + ' %', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('ROI', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.ROI * 100).toFixed(2) + ' %', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Periods', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.periods, X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Days', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.days, X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Anualized Rate of Return', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.anualizedRateOfReturn * 100).toFixed(2) + ' %', X_AXIS - thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
|
||||
y = bifurcationLevel
|
||||
|
||||
y = y + increment;
|
||||
y = y + increment;
|
||||
printLabel('Final Results', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Profit / Loss', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(lastRecord.profit, X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Trades', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(lastRecord.roundtrips, X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Hits', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(lastRecord.hits, X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Fails', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(lastRecord.fails, X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Hit Ratio', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel((lastRecord.hitRatio * 100).toFixed(2) + ' %', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('ROI', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel((lastRecord.ROI * 100).toFixed(2) + ' %', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Periods', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(lastRecord.periods, X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Days', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel(lastRecord.days, X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Anualized Rate of Return', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '0.60');
|
||||
y = y + increment;
|
||||
printLabel((lastRecord.anualizedRateOfReturn * 100).toFixed(2) + ' %', X_AXIS + thisObject.container.frame.width / 4, frameTitleHeight + frameBodyHeight * y, '1.00', 14);
|
||||
|
||||
|
||||
|
||||
function printLabel(labelToPrint, x, y, opacity, fontSize) {
|
||||
|
||||
let labelPoint;
|
||||
if (fontSize === undefined) { fontSize = 10 };
|
||||
|
||||
browserCanvasContext.font = fontSize + 'px ' + UI_FONT.PRIMARY;
|
||||
|
||||
let label = '' + labelToPrint;
|
||||
if (isNaN(label) === false) {
|
||||
label = Number(label).toLocaleString();
|
||||
if ((label === "-0" || label === "0") && (labelToPrint !== 0) && (labelToPrint !== "0.00")) {
|
||||
label = Number(labelToPrint).toFixed(6);
|
||||
}
|
||||
}
|
||||
let xOffset = label.length / 2 * fontSize * FONT_ASPECT_RATIO;
|
||||
|
||||
labelPoint = {
|
||||
x: x - xOffset,
|
||||
y: y
|
||||
};
|
||||
|
||||
labelPoint = thisObject.container.frame.frameThisPoint(labelPoint);
|
||||
labelPoint = thisObject.fitFunction(labelPoint)
|
||||
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.DARK + ', ' + opacity + ')';
|
||||
browserCanvasContext.fillText(label, labelPoint.x, labelPoint.y);
|
||||
|
||||
}
|
||||
|
||||
browserCanvasContext.closePath();
|
||||
browserCanvasContext.fill();
|
||||
|
||||
/* Parameters */
|
||||
let params
|
||||
let paramsArray = []
|
||||
let positionTaken = false
|
||||
|
||||
if (currentRecord.positionSize > 0) {
|
||||
positionTaken = true
|
||||
}
|
||||
|
||||
params = {}
|
||||
params.VALUE = currentRecord.balanceA;
|
||||
params.INIT_VALUE = currentRecord.initialBalanceA
|
||||
params.MIN_VALUE = currentRecord.minimunBalanceA
|
||||
params.MAX_VALUE = currentRecord.maximunBalanceA
|
||||
params.ASSET_LABEL = 'Asset A'
|
||||
params.ASSET_NAME = DEFAULT_MARKET.assetB
|
||||
params.LEFT_OFFSET = 100
|
||||
params.POSITION_TAKEN = positionTaken
|
||||
params.BASE_ASSET = currentRecord.baseAsset
|
||||
params.DECIMALS = 4
|
||||
|
||||
paramsArray.push(params)
|
||||
|
||||
params = {}
|
||||
params.VALUE = currentRecord.balanceB;
|
||||
params.MIN_VALUE = currentRecord.minimunBalanceB
|
||||
params.INIT_VALUE = currentRecord.initialBalanceB
|
||||
params.MAX_VALUE = currentRecord.maximunBalanceB
|
||||
params.ASSET_LABEL = 'Asset B'
|
||||
params.ASSET_NAME = DEFAULT_MARKET.assetA
|
||||
params.LEFT_OFFSET = 220
|
||||
params.POSITION_TAKEN = positionTaken
|
||||
params.BASE_ASSET = currentRecord.baseAsset
|
||||
params.DECIMALS = 2
|
||||
|
||||
paramsArray.push(params)
|
||||
|
||||
canvas.cockpitSpace.assetBalances.setParamsArray(paramsArray)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+7
-7
@@ -342,7 +342,7 @@
|
||||
function plotChart() {
|
||||
try {
|
||||
|
||||
let currentRecord
|
||||
let record
|
||||
|
||||
let point = {
|
||||
x: 0,
|
||||
@@ -358,7 +358,7 @@
|
||||
for (let i = 0; i < history.length; i++) {
|
||||
|
||||
record = history[i];
|
||||
currentRecord = record
|
||||
record = record
|
||||
|
||||
let timestamp = record.date // Math.trunc(record.date / timeFrame) * timeFrame + timeFrame / 2;
|
||||
|
||||
@@ -427,7 +427,7 @@
|
||||
point2.y = point2.y - diff;
|
||||
point3.y = point3.y - diff;
|
||||
|
||||
currentRecord.timeFrame = diff
|
||||
record.timeFrame = diff
|
||||
|
||||
point2 = canvas.chartingSpace.viewport.fitIntoVisibleArea(point2);
|
||||
point3 = canvas.chartingSpace.viewport.fitIntoVisibleArea(point3);
|
||||
@@ -502,7 +502,7 @@
|
||||
point2.y = point2.y + diff;
|
||||
point3.y = point3.y + diff;
|
||||
|
||||
currentRecord.timeFrame = diff
|
||||
record.timeFrame = diff
|
||||
|
||||
point2 = canvas.chartingSpace.viewport.fitIntoVisibleArea(point2);
|
||||
point3 = canvas.chartingSpace.viewport.fitIntoVisibleArea(point3);
|
||||
@@ -575,7 +575,7 @@
|
||||
point2.y = point2.y - diff;
|
||||
point3.y = point3.y - diff;
|
||||
|
||||
currentRecord.timeFrame = diff
|
||||
record.timeFrame = diff
|
||||
|
||||
point2 = canvas.chartingSpace.viewport.fitIntoVisibleArea(point2);
|
||||
point3 = canvas.chartingSpace.viewport.fitIntoVisibleArea(point3);
|
||||
@@ -649,7 +649,7 @@
|
||||
point2.y = point2.y + diff;
|
||||
point3.y = point3.y + diff;
|
||||
|
||||
currentRecord.timeFrame = diff
|
||||
record.timeFrame = diff
|
||||
|
||||
point2 = canvas.chartingSpace.viewport.fitIntoVisibleArea(point2);
|
||||
point3 = canvas.chartingSpace.viewport.fitIntoVisibleArea(point3);
|
||||
@@ -683,7 +683,7 @@
|
||||
/* Send the current record to the panel */
|
||||
|
||||
if (userPositionDate >= record.date - 30000 && userPositionDate < record.date + 30000) {
|
||||
thisObject.container.eventHandler.raiseEvent("Current Record Changed", currentRecord);
|
||||
thisObject.container.eventHandler.raiseEvent("Current Record Changed", record);
|
||||
}
|
||||
|
||||
/* Circles */
|
||||
|
||||
+13
-13
@@ -19,7 +19,7 @@ function newTradingEnginesPlottersTradingSimulationSimulationExecutionSimulation
|
||||
|
||||
container.frame.containerName = "Trading Execution";
|
||||
|
||||
let currentRecord;
|
||||
let record;
|
||||
let upDownButton
|
||||
|
||||
return thisObject;
|
||||
@@ -30,7 +30,7 @@ function newTradingEnginesPlottersTradingSimulationSimulationExecutionSimulation
|
||||
thisObject.fitFunction = undefined
|
||||
thisObject.isVisible = undefined
|
||||
|
||||
currentRecord = undefined
|
||||
record = undefined
|
||||
upDownButton.finalize()
|
||||
upDownButton = undefined
|
||||
}
|
||||
@@ -75,7 +75,7 @@ function newTradingEnginesPlottersTradingSimulationSimulationExecutionSimulation
|
||||
|
||||
function onRecordChange(lastCurrentCandle) {
|
||||
|
||||
currentRecord = lastCurrentCandle;
|
||||
record = lastCurrentCandle;
|
||||
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ function newTradingEnginesPlottersTradingSimulationSimulationExecutionSimulation
|
||||
|
||||
function plot() {
|
||||
|
||||
if (currentRecord === undefined) { return; }
|
||||
if (record === undefined) { return; }
|
||||
|
||||
const frameBodyHeight = thisObject.container.frame.getBodyHeight();
|
||||
const frameTitleHeight = thisObject.container.frame.height - frameBodyHeight;
|
||||
@@ -101,7 +101,7 @@ function newTradingEnginesPlottersTradingSimulationSimulationExecutionSimulation
|
||||
const X_AXIS = thisObject.container.frame.width / 2;
|
||||
const Y_AXIS = frameTitleHeight + frameBodyHeight / 2;
|
||||
|
||||
record = currentRecord
|
||||
record = record
|
||||
|
||||
point = {
|
||||
x: X_AXIS,
|
||||
@@ -395,28 +395,28 @@ function newTradingEnginesPlottersTradingSimulationSimulationExecutionSimulation
|
||||
browserCanvasContext.beginPath();
|
||||
|
||||
let y;
|
||||
let recordDate = new Date(currentRecord.datetime)
|
||||
let recordDate = new Date(record.datetime)
|
||||
|
||||
printLabel('Market Rate', X_AXIS, frameTitleHeight + frameBodyHeight * 0.05 / 2, '1');
|
||||
printLabel(currentRecord.marketRate, X_AXIS, frameTitleHeight + frameBodyHeight * 0.10 / 2, '0.50');
|
||||
printLabel(record.marketRate, X_AXIS, frameTitleHeight + frameBodyHeight * 0.10 / 2, '0.50');
|
||||
|
||||
printLabel('Sell Rate', X_AXIS, frameTitleHeight + frameBodyHeight * 0.15 / 2, '1');
|
||||
printLabel(currentRecord.lastSellRate, X_AXIS, frameTitleHeight + frameBodyHeight * 0.20 / 2, '0.50');
|
||||
printLabel(record.lastSellRate, X_AXIS, frameTitleHeight + frameBodyHeight * 0.20 / 2, '0.50');
|
||||
|
||||
printLabel('Sell Executed Rate', X_AXIS, frameTitleHeight + frameBodyHeight * 0.25 / 2, '1');
|
||||
printLabel(currentRecord.sellExecRate, X_AXIS, frameTitleHeight + frameBodyHeight * 0.30 / 2, '0.50');
|
||||
printLabel(record.sellExecRate, X_AXIS, frameTitleHeight + frameBodyHeight * 0.30 / 2, '0.50');
|
||||
|
||||
printLabel('Buy Rate', X_AXIS, frameTitleHeight + frameBodyHeight * 0.35 / 2, '1');
|
||||
printLabel(currentRecord.lastBuyRate, X_AXIS, frameTitleHeight + frameBodyHeight * 0.40 / 2, '0.40');
|
||||
printLabel(record.lastBuyRate, X_AXIS, frameTitleHeight + frameBodyHeight * 0.40 / 2, '0.40');
|
||||
|
||||
printLabel('Buy Executed Rate', X_AXIS, frameTitleHeight + frameBodyHeight * 0.45 / 2, '1');
|
||||
printLabel(currentRecord.buyExecRate, X_AXIS, frameTitleHeight + frameBodyHeight * 0.50 / 2, '0.50');
|
||||
printLabel(record.buyExecRate, X_AXIS, frameTitleHeight + frameBodyHeight * 0.50 / 2, '0.50');
|
||||
|
||||
printLabel('ROI Asset A', X_AXIS, frameTitleHeight + frameBodyHeight * (1 - 0.25 / 2), '1');
|
||||
printLabel((currentRecord.combinedProfitsB).toFixed(2) + '%', X_AXIS, frameTitleHeight + frameBodyHeight * (1 - 0.30 / 2), '0.50');
|
||||
printLabel((record.combinedProfitsB).toFixed(2) + '%', X_AXIS, frameTitleHeight + frameBodyHeight * (1 - 0.30 / 2), '0.50');
|
||||
|
||||
printLabel('ROI Asset B', X_AXIS, frameTitleHeight + frameBodyHeight * (1 - 0.15 / 2), '1');
|
||||
printLabel((currentRecord.combinedProfitsA).toFixed(2) + '%', X_AXIS, frameTitleHeight + frameBodyHeight * (1 - 0.20 / 2), '0.50');
|
||||
printLabel((record.combinedProfitsA).toFixed(2) + '%', X_AXIS, frameTitleHeight + frameBodyHeight * (1 - 0.20 / 2), '0.50');
|
||||
|
||||
printLabel('Datetime', X_AXIS, frameTitleHeight + frameBodyHeight * (1 - 0.05 / 2), '1');
|
||||
printLabel(recordDate.toUTCString(), X_AXIS, frameTitleHeight + frameBodyHeight * (1 - 0.1 / 2), '0.50');
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
// Secondary functions and properties.
|
||||
|
||||
currentRecord: undefined
|
||||
record: undefined
|
||||
};
|
||||
|
||||
/* this is part of the module template */
|
||||
@@ -383,7 +383,7 @@
|
||||
record.number = dailyFile[i][3];
|
||||
record.beginRate = dailyFile[i][4];
|
||||
record.endRate = dailyFile[i][5];
|
||||
record.triggerOnSituation = dailyFile[i][6];
|
||||
record.situationName = dailyFile[i][6];
|
||||
record.name = dailyFile[i][7];
|
||||
|
||||
if (
|
||||
@@ -395,8 +395,8 @@
|
||||
|
||||
if (datetime.valueOf() >= record.begin && datetime.valueOf() <= record.end) {
|
||||
|
||||
thisObject.currentRecord = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Strategy Changed", thisObject.currentRecord);
|
||||
thisObject.record = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Strategy Changed", thisObject.record);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -456,7 +456,7 @@
|
||||
record.number = marketFile[i][3];
|
||||
record.beginRate = marketFile[i][4];
|
||||
record.endRate = marketFile[i][5];
|
||||
record.triggerOnSituation = marketFile[i][6];
|
||||
record.situationName = marketFile[i][6];
|
||||
record.name = marketFile[i][7];
|
||||
|
||||
if (record.begin >= leftDate.valueOf() && record.end <= rightDate.valueOf()) {
|
||||
@@ -468,8 +468,8 @@
|
||||
(record.begin >= coordinateSystem.min.x && record.end <= coordinateSystem.max.x)
|
||||
) {
|
||||
|
||||
thisObject.currentRecord = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Strategy Changed", thisObject.currentRecord);
|
||||
thisObject.record = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Strategy Changed", thisObject.record);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -588,8 +588,8 @@
|
||||
if (record.name !== "New Strategy") {
|
||||
printLabel(record.name, recordPoint1.x + 5, positionY - 15, '1', 12);
|
||||
}
|
||||
if (record.triggerOnSituation !== "New Situation") {
|
||||
printLabel(record.triggerOnSituation, recordPoint1.x + 5, positionY, '1', 12);
|
||||
if (record.situationName !== "New Situation") {
|
||||
printLabel(record.situationName, recordPoint1.x + 5, positionY, '1', 12);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -609,9 +609,9 @@
|
||||
|
||||
if (userPositionDate >= record.begin && userPositionDate <= record.end) {
|
||||
|
||||
let currentRecord = {
|
||||
let record = {
|
||||
};
|
||||
thisObject.container.eventHandler.raiseEvent("Current Strategy Record Changed", currentRecord);
|
||||
thisObject.container.eventHandler.raiseEvent("Current Strategy Record Changed", record);
|
||||
}
|
||||
|
||||
function drawStick(point1, point2) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
// Secondary functions and properties.
|
||||
|
||||
currentRecord: undefined
|
||||
record: undefined
|
||||
};
|
||||
|
||||
/* this is part of the module template */
|
||||
@@ -366,11 +366,11 @@
|
||||
record.begin = dailyFile[i][0];
|
||||
record.end = dailyFile[i][1];
|
||||
record.status = dailyFile[i][2];
|
||||
record.lastTradeROI = dailyFile[i][3];
|
||||
record.variable_last_position_ROI = dailyFile[i][3];
|
||||
record.beginRate = dailyFile[i][4];
|
||||
record.endRate = dailyFile[i][5];
|
||||
record.exitType = dailyFile[i][6];
|
||||
record.takePositionSituation = dailyFile[i][7];
|
||||
record.situationName = dailyFile[i][7];
|
||||
|
||||
if (
|
||||
(record.begin >= farLeftDate.valueOf() && record.end <= farRightDate.valueOf()) &&
|
||||
@@ -381,8 +381,8 @@
|
||||
|
||||
if (datetime.valueOf() >= record.begin && datetime.valueOf() <= record.end) {
|
||||
|
||||
thisObject.currentRecord = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Trade Changed", thisObject.currentRecord);
|
||||
thisObject.record = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Trade Changed", thisObject.record);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -432,11 +432,11 @@
|
||||
record.begin = marketFile[i][0];
|
||||
record.end = marketFile[i][1];
|
||||
record.status = marketFile[i][2];
|
||||
record.lastTradeROI = marketFile[i][3];
|
||||
record.variable_last_position_ROI = marketFile[i][3];
|
||||
record.beginRate = marketFile[i][4];
|
||||
record.endRate = marketFile[i][5];
|
||||
record.exitType = marketFile[i][6];
|
||||
record.takePositionSituation = marketFile[i][7];
|
||||
record.situationName = marketFile[i][7];
|
||||
|
||||
if (
|
||||
(record.begin >= leftDate.valueOf() && record.end <= rightDate.valueOf()) &&
|
||||
@@ -447,8 +447,8 @@
|
||||
|
||||
if (datetime.valueOf() >= record.begin && datetime.valueOf() <= record.end) {
|
||||
|
||||
thisObject.currentRecord = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Trade Changed", thisObject.currentRecord);
|
||||
thisObject.record = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Trade Changed", thisObject.record);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -478,9 +478,9 @@
|
||||
|
||||
if (userPositionDate >= record.begin && userPositionDate <= record.end) {
|
||||
|
||||
let currentRecord = {
|
||||
let record = {
|
||||
};
|
||||
thisObject.container.eventHandler.raiseEvent("Current Trade Record Changed", currentRecord);
|
||||
thisObject.container.eventHandler.raiseEvent("Current Trade Record Changed", record);
|
||||
}
|
||||
|
||||
let recordPoint1 = {
|
||||
@@ -518,7 +518,7 @@
|
||||
recordPoint2 = thisObject.fitFunction(recordPoint2);
|
||||
recordPoint3 = thisObject.fitFunction(recordPoint3);
|
||||
|
||||
let line0 = record.takePositionSituation
|
||||
let line0 = record.situationName
|
||||
let line1 = '';
|
||||
let line2 = '';
|
||||
|
||||
@@ -541,10 +541,10 @@
|
||||
line1 = 'Open Position';
|
||||
}
|
||||
|
||||
if (record.lastTradeROI < 0) {
|
||||
line2 = 'ROI:' + (record.lastTradeROI).toFixed(2) + ' %';
|
||||
if (record.variable_last_position_ROI < 0) {
|
||||
line2 = 'ROI:' + (record.variable_last_position_ROI).toFixed(2) + ' %';
|
||||
} else {
|
||||
line2 = 'ROI:' + (record.lastTradeROI).toFixed(2) + ' %';
|
||||
line2 = 'ROI:' + (record.variable_last_position_ROI).toFixed(2) + ' %';
|
||||
}
|
||||
|
||||
/* Draw the triangle that represents the trade. */
|
||||
@@ -559,7 +559,7 @@
|
||||
|
||||
let opacity = '0.25';
|
||||
|
||||
if (record.lastTradeROI > 0) {
|
||||
if (record.variable_last_position_ROI > 0) {
|
||||
browserCanvasContext.strokeStyle = 'rgba(' + UI_COLOR.PATINATED_TURQUOISE + ', ' + opacity + ')';
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.GREEN + ', ' + opacity + ')';
|
||||
} else {
|
||||
|
||||
+90
-99
@@ -26,7 +26,7 @@
|
||||
|
||||
// Secondary functions and properties.
|
||||
|
||||
currentRecord: undefined
|
||||
record: undefined
|
||||
};
|
||||
|
||||
/* this is part of the module template */
|
||||
@@ -149,7 +149,7 @@
|
||||
|
||||
/* Loading a few icons */
|
||||
|
||||
imageStopLossPhase = canvas.designSpace.iconByUiObjectType.get('Stop');
|
||||
imageStopLossPhase = canvas.designSpace.iconByUiObjectType.get('Managed Stop Loss');
|
||||
imageTakeProfitPhase = canvas.designSpace.iconByUiObjectType.get('Phase');
|
||||
imageRecord = canvas.designSpace.iconByUiObjectType.get('Trading System');
|
||||
|
||||
@@ -353,42 +353,38 @@
|
||||
|
||||
record.begin = dailyFile[i][0];
|
||||
record.end = dailyFile[i][1];
|
||||
record.type = dailyFile[i][2];
|
||||
record.rate = dailyFile[i][3];
|
||||
record.amount = dailyFile[i][4];
|
||||
record.balanceA = dailyFile[i][5];
|
||||
record.balanceB = dailyFile[i][6];
|
||||
record.profit = dailyFile[i][7];
|
||||
record.lastTradeProfitLoss = dailyFile[i][8];
|
||||
record.stopLoss = dailyFile[i][9];
|
||||
record.roundtrips = dailyFile[i][10];
|
||||
record.hits = dailyFile[i][11];
|
||||
record.fails = dailyFile[i][12];
|
||||
record.hitRatio = dailyFile[i][13];
|
||||
record.ROI = dailyFile[i][14];
|
||||
record.periods = dailyFile[i][15];
|
||||
record.days = dailyFile[i][16];
|
||||
record.anualizedRateOfReturn = dailyFile[i][17];
|
||||
record.sellRate = dailyFile[i][18];
|
||||
record.lastTradeROI = dailyFile[i][19];
|
||||
record.strategy = dailyFile[i][20];
|
||||
record.strategyPhase = dailyFile[i][21];
|
||||
record.takeProfit = dailyFile[i][22];
|
||||
record.stopLossPhase = dailyFile[i][23];
|
||||
record.takeProfitPhase = dailyFile[i][24];
|
||||
record.positionSize = dailyFile[i][26]; // 25 is the message for the executor
|
||||
record.initialBalanceA = dailyFile[i][27];
|
||||
record.minimunBalanceA = dailyFile[i][28];
|
||||
record.maximunBalanceA = dailyFile[i][29];
|
||||
record.initialBalanceB = dailyFile[i][30];
|
||||
record.minimunBalanceB = dailyFile[i][31];
|
||||
record.maximunBalanceB = dailyFile[i][32];
|
||||
record.baseAsset = dailyFile[i][33];
|
||||
record.quotedAsset = dailyFile[i][34];
|
||||
record.marketBaseAsset = dailyFile[i][35];
|
||||
record.marketQuotedAsset = dailyFile[i][36];
|
||||
record.positionPeriods = dailyFile[i][37];
|
||||
record.positionDays = dailyFile[i][38];
|
||||
record.variable_current_balance_baseAsset = dailyFile[i][2];
|
||||
record.variable_current_balance_quotedAsset = dailyFile[i][3];
|
||||
record.variable_episode_stat_profitLoss = dailyFile[i][4];
|
||||
record.variable_last_position_profitLoss = dailyFile[i][5];
|
||||
record.variable_current_position_stopLoss_value = dailyFile[i][6];
|
||||
record.variable_episode_count_positions = dailyFile[i][7];
|
||||
record.variable_episode_count_hits = dailyFile[i][8];
|
||||
record.variable_episode_count_fails = dailyFile[i][9];
|
||||
record.variable_episode_stat_hitRatio = dailyFile[i][10];
|
||||
record.variable_episode_stat_ROI = dailyFile[i][11];
|
||||
record.variable_episode_count_periods = dailyFile[i][12];
|
||||
record.variable_episode_stat_days = dailyFile[i][13];
|
||||
record.variable_episode_stat_anualizedRateOfReturn = dailyFile[i][14];
|
||||
record.variable_current_position_rate = dailyFile[i][15];
|
||||
record.variable_last_position_ROI = dailyFile[i][16];
|
||||
record.strategy = dailyFile[i][17];
|
||||
record.variable_current_position_takeProfit_value = dailyFile[i][18];
|
||||
record.variable_current_position_stopLoss_phase = dailyFile[i][19];
|
||||
record.variable_current_position_takeProfit_phase = dailyFile[i][20];
|
||||
record.variable_current_position_size = dailyFile[i][21]; // 25 is the message for the executor
|
||||
record.variable_episode_parameters_initial_balance_baseAsset = dailyFile[i][22];
|
||||
record.variable_episode_parameters_minimum_balance_baseAsset = dailyFile[i][23];
|
||||
record.variable_episode_parameters_maximum_balance_baseAsset = dailyFile[i][24];
|
||||
record.variable_episode_parameters_initial_balance_quotedAsset = dailyFile[i][25];
|
||||
record.variable_episode_parameters_minimum_balance_quotedAsset = dailyFile[i][26];
|
||||
record.variable_episode_parameters_maximum_balance_quotedAsset = dailyFile[i][27];
|
||||
record.variable_episode_parameters_baseAsset = dailyFile[i][28];
|
||||
record.variable_episode_parameters_quotedAsset = dailyFile[i][29];
|
||||
record.variable_episode_parameters_marketBaseAsset = dailyFile[i][30];
|
||||
record.variable_episode_parameters_marketQuotedAsset = dailyFile[i][31];
|
||||
record.variable_current_position_count_periods = dailyFile[i][32];
|
||||
record.variable_current_position_stat_days = dailyFile[i][33];
|
||||
|
||||
if (
|
||||
(record.begin >= farLeftDate.valueOf() && record.end <= farRightDate.valueOf()) &&
|
||||
@@ -399,8 +395,8 @@
|
||||
|
||||
if (datetime.valueOf() >= record.begin && datetime.valueOf() <= record.end) {
|
||||
|
||||
thisObject.currentRecord = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Record Changed", thisObject.currentRecord);
|
||||
thisObject.record = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Record Changed", thisObject.record);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -447,42 +443,37 @@
|
||||
|
||||
record.begin = marketFile[i][0];
|
||||
record.end = marketFile[i][1];
|
||||
record.type = marketFile[i][2];
|
||||
record.rate = marketFile[i][3];
|
||||
record.amount = marketFile[i][4];
|
||||
record.balanceA = marketFile[i][5];
|
||||
record.balanceB = marketFile[i][6];
|
||||
record.profit = marketFile[i][7];
|
||||
record.lastTradeProfitLoss = marketFile[i][8];
|
||||
record.stopLoss = marketFile[i][9];
|
||||
record.roundtrips = marketFile[i][10];
|
||||
record.hits = marketFile[i][11];
|
||||
record.fails = marketFile[i][12];
|
||||
record.hitRatio = marketFile[i][13];
|
||||
record.ROI = marketFile[i][14];
|
||||
record.periods = marketFile[i][15];
|
||||
record.days = marketFile[i][16];
|
||||
record.anualizedRateOfReturn = marketFile[i][17];
|
||||
record.sellRate = marketFile[i][18];
|
||||
record.lastTradeROI = marketFile[i][19];
|
||||
record.strategy = marketFile[i][20];
|
||||
record.strategyPhase = marketFile[i][21];
|
||||
record.takeProfit = marketFile[i][22];
|
||||
record.stopLossPhase = marketFile[i][23];
|
||||
record.takeProfitPhase = marketFile[i][24];
|
||||
record.positionSize = marketFile[i][26]; // 25 is the message for the executor
|
||||
record.initialBalanceA = marketFile[i][27];
|
||||
record.minimunBalanceA = marketFile[i][28];
|
||||
record.maximunBalanceA = marketFile[i][29];
|
||||
record.initialBalanceB = marketFile[i][30];
|
||||
record.minimunBalanceB = marketFile[i][31];
|
||||
record.maximunBalanceB = marketFile[i][32];
|
||||
record.baseAsset = marketFile[i][33];
|
||||
record.quotedAsset = marketFile[i][34];
|
||||
record.marketBaseAsset = marketFile[i][35];
|
||||
record.marketQuotedAsset = marketFile[i][36];
|
||||
record.positionPeriods = marketFile[i][37];
|
||||
record.positionDays = marketFile[i][38];
|
||||
record.variable_current_balance_baseAsset = marketFile[i][2];
|
||||
record.variable_current_balance_quotedAsset = marketFile[i][3];
|
||||
record.variable_episode_stat_profitLoss = marketFile[i][4];
|
||||
record.variable_last_position_profitLoss = marketFile[i][5];
|
||||
record.variable_current_position_stopLoss_value = marketFile[i][6];
|
||||
record.variable_episode_count_positions = marketFile[i][7];
|
||||
record.variable_episode_count_hits = marketFile[i][8];
|
||||
record.variable_episode_count_fails = marketFile[i][9];
|
||||
record.variable_episode_stat_hitRatio = marketFile[i][10];
|
||||
record.variable_episode_stat_ROI = marketFile[i][11];
|
||||
record.variable_episode_count_periods = marketFile[i][12];
|
||||
record.variable_episode_stat_days = marketFile[i][13];
|
||||
record.variable_episode_stat_anualizedRateOfReturn = marketFile[i][14];
|
||||
record.variable_current_position_rate = marketFile[i][15];
|
||||
record.variable_last_position_ROI = marketFile[i][16];
|
||||
record.variable_current_position_takeProfit_value = marketFile[i][17];
|
||||
record.variable_current_position_stopLoss_phase = marketFile[i][18];
|
||||
record.variable_current_position_takeProfit_phase = marketFile[i][19];
|
||||
record.variable_current_position_size = marketFile[i][20];
|
||||
record.variable_episode_parameters_initial_balance_baseAsset = marketFile[i][21];
|
||||
record.variable_episode_parameters_minimum_balance_baseAsset = marketFile[i][22];
|
||||
record.variable_episode_parameters_maximum_balance_baseAsset = marketFile[i][23];
|
||||
record.variable_episode_parameters_initial_balance_quotedAsset = marketFile[i][24];
|
||||
record.variable_episode_parameters_minimum_balance_quotedAsset = marketFile[i][25];
|
||||
record.variable_episode_parameters_maximum_balance_quotedAsset = marketFile[i][26];
|
||||
record.variable_episode_parameters_baseAsset = marketFile[i][27];
|
||||
record.variable_episode_parameters_quotedAsset = marketFile[i][28];
|
||||
record.variable_episode_parameters_marketBaseAsset = marketFile[i][29];
|
||||
record.variable_episode_parameters_marketQuotedAsset = marketFile[i][30];
|
||||
record.variable_current_position_count_periods = marketFile[i][31];
|
||||
record.variable_current_position_stat_days = marketFile[i][32];
|
||||
|
||||
if (
|
||||
(record.begin >= leftDate.valueOf() && record.end <= rightDate.valueOf()) &&
|
||||
@@ -493,8 +484,8 @@
|
||||
|
||||
if (datetime.valueOf() >= record.begin && datetime.valueOf() <= record.end) {
|
||||
|
||||
thisObject.currentRecord = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Record Changed", thisObject.currentRecord);
|
||||
thisObject.record = record;
|
||||
thisObject.container.eventHandler.raiseEvent("Current Record Changed", thisObject.record);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -521,11 +512,11 @@
|
||||
record = records[i];
|
||||
|
||||
/* Contributing to Auto-Scale*/
|
||||
if (record.stopLoss !== 0) {
|
||||
coordinateSystem.reportYValue(record.stopLoss)
|
||||
if (record.variable_current_position_stopLoss_value !== 0) {
|
||||
coordinateSystem.reportYValue(record.variable_current_position_stopLoss_value)
|
||||
}
|
||||
if (record.takeProfit !== 0) {
|
||||
coordinateSystem.reportYValue(record.takeProfit)
|
||||
if (record.variable_current_position_takeProfit_value !== 0) {
|
||||
coordinateSystem.reportYValue(record.variable_current_position_takeProfit_value)
|
||||
}
|
||||
|
||||
/* Send the current record to the panel */
|
||||
@@ -533,7 +524,7 @@
|
||||
if (userPositionDate >= record.begin && userPositionDate <= record.end) {
|
||||
|
||||
let eventRecords = {
|
||||
currentRecord: record
|
||||
record: record
|
||||
};
|
||||
thisObject.container.eventHandler.raiseEvent("Current Record Changed", eventRecords);
|
||||
}
|
||||
@@ -542,12 +533,12 @@
|
||||
let takeProfitPhase = -1;
|
||||
|
||||
if (i > 0) {
|
||||
if (record.stopLossPhase !== records[i - 1].stopLossPhase) {
|
||||
stopLossPhase = record.stopLossPhase;
|
||||
if (record.variable_current_position_stopLoss_phase !== records[i - 1].variable_current_position_stopLoss_phase) {
|
||||
stopLossPhase = record.variable_current_position_stopLoss_phase;
|
||||
}
|
||||
|
||||
if (record.takeProfitPhase !== records[i - 1].takeProfitPhase) {
|
||||
takeProfitPhase = record.takeProfitPhase;
|
||||
if (record.variable_current_position_takeProfit_phase !== records[i - 1].variable_current_position_takeProfit_phase) {
|
||||
takeProfitPhase = record.variable_current_position_takeProfit_phase;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -573,15 +564,15 @@
|
||||
|
||||
let recordPoint5 = {
|
||||
x: record.begin,
|
||||
y: record.stopLoss
|
||||
y: record.variable_current_position_stopLoss_value
|
||||
};
|
||||
|
||||
let recordPoint6 = {
|
||||
x: record.end,
|
||||
y: record.stopLoss
|
||||
y: record.variable_current_position_stopLoss_value
|
||||
};
|
||||
|
||||
if (record.stopLoss === 0) { // Put these points out of range if stopLoss is zero.
|
||||
if (record.variable_current_position_stopLoss_value === 0) { // Put these points out of range if stopLoss is zero.
|
||||
|
||||
recordPoint5.x = 0;
|
||||
recordPoint6.x = 0;
|
||||
@@ -589,15 +580,15 @@
|
||||
|
||||
let recordPoint7 = {
|
||||
x: record.begin,
|
||||
y: record.sellRate
|
||||
y: record.variable_current_position_rate
|
||||
};
|
||||
|
||||
let recordPoint8 = {
|
||||
x: record.end,
|
||||
y: record.sellRate
|
||||
y: record.variable_current_position_rate
|
||||
};
|
||||
|
||||
if (record.sellRate === 0) { // Put these points out of range if sellRate is zero.
|
||||
if (record.variable_current_position_rate === 0) { // Put these points out of range if sellRate is zero.
|
||||
|
||||
recordPoint7.x = 0;
|
||||
recordPoint8.x = 0;
|
||||
@@ -605,15 +596,15 @@
|
||||
|
||||
let recordPoint9 = {
|
||||
x: record.begin,
|
||||
y: record.takeProfit
|
||||
y: record.variable_current_position_takeProfit_value
|
||||
};
|
||||
|
||||
let recordPoint10 = {
|
||||
x: record.end,
|
||||
y: record.takeProfit
|
||||
y: record.variable_current_position_takeProfit_value
|
||||
};
|
||||
|
||||
if (record.takeProfit === 0) { // Put these points out of range if takeProfit is zero.
|
||||
if (record.variable_current_position_takeProfit_value === 0) { // Put these points out of range if takeProfit is zero.
|
||||
|
||||
recordPoint9.x = 0;
|
||||
recordPoint10.x = 0;
|
||||
@@ -670,7 +661,7 @@
|
||||
y: -30
|
||||
}
|
||||
let imageSize = (recordPoint2.x - recordPoint1.x) / 2;
|
||||
let recordLabel = record.periods.toLocaleString()
|
||||
let recordLabel = record.variable_episode_count_periods.toLocaleString()
|
||||
if (imageSize < 8) {
|
||||
if (recordLabel[recordLabel.length - 1] !== '0' || imageSize < 4)
|
||||
recordLabel = ''
|
||||
@@ -728,10 +719,10 @@
|
||||
imageSize = 20;
|
||||
let imageToDraw;
|
||||
|
||||
/* Depending on what is on top, it is also the text and image of the take profit / stop loss */
|
||||
/* Depending on what is on top, it is also the text and image of the take accumulatedProfitLoss / stop loss */
|
||||
|
||||
let yOffset = 0
|
||||
if (record.takeProfit > record.stopLoss) { yOffset = imageSize * 2 }
|
||||
if (record.variable_current_position_takeProfit_value > record.variable_current_position_stopLoss_value) { yOffset = imageSize * 2 }
|
||||
|
||||
/* Next we are drawing the stopLoss floor / ceilling */
|
||||
|
||||
|
||||
+30
-30
@@ -19,7 +19,7 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
|
||||
container.frame.containerName = "Simulation Asset Balances Panel";
|
||||
|
||||
let currentRecord;
|
||||
let record;
|
||||
let lastRecord;
|
||||
let upDownButton
|
||||
|
||||
@@ -56,7 +56,7 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
thisObject.onRecordChange = undefined
|
||||
thisObject.isVisible = undefined
|
||||
|
||||
currentRecord = undefined
|
||||
record = undefined
|
||||
lastRecord = undefined
|
||||
upDownButton = undefined
|
||||
|
||||
@@ -89,7 +89,7 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
|
||||
function onRecordChange(records) {
|
||||
|
||||
currentRecord = records.currentRecord;
|
||||
record = records.record;
|
||||
lastRecord = records.lastRecord
|
||||
|
||||
}
|
||||
@@ -117,7 +117,7 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
|
||||
function plotCurrentRecordInfo() {
|
||||
|
||||
if (currentRecord === undefined) { return; }
|
||||
if (record === undefined) { return; }
|
||||
|
||||
const frameBodyHeight = thisObject.container.frame.getBodyHeight();
|
||||
const frameTitleHeight = thisObject.container.frame.height - frameBodyHeight;
|
||||
@@ -139,7 +139,7 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
let paramsArray = []
|
||||
let positionTaken = false
|
||||
|
||||
if (currentRecord.positionSize > 0) {
|
||||
if (record.variable_current_position_size > 0) {
|
||||
positionTaken = true
|
||||
}
|
||||
|
||||
@@ -154,59 +154,59 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
return
|
||||
}
|
||||
|
||||
if (currentRecord.baseAsset === currentRecord.marketBaseAsset) {
|
||||
if (record.variable_episode_parameters_baseAsset === record.variable_episode_parameters_marketBaseAsset) {
|
||||
params = {}
|
||||
params.VALUE = currentRecord.balanceA;
|
||||
params.INIT_VALUE = currentRecord.initialBalanceA
|
||||
params.MIN_VALUE = currentRecord.minimunBalanceA
|
||||
params.MAX_VALUE = currentRecord.maximunBalanceA
|
||||
params.VALUE = record.variable_current_balance_baseAsset;
|
||||
params.INIT_VALUE = record.variable_episode_parameters_initial_balance_baseAsset
|
||||
params.MIN_VALUE = record.variable_episode_parameters_minimum_balance_baseAsset
|
||||
params.MAX_VALUE = record.variable_episode_parameters_maximum_balance_baseAsset
|
||||
params.ASSET_LABEL = 'Base'
|
||||
params.ASSET_NAME = currentRecord.baseAsset
|
||||
params.ASSET_NAME = record.variable_episode_parameters_baseAsset
|
||||
params.LEFT_OFFSET = X_AXIS
|
||||
params.POSITION_TAKEN = positionTaken
|
||||
params.BASE_ASSET = currentRecord.baseAsset
|
||||
params.BASE_ASSET = record.variable_episode_parameters_baseAsset
|
||||
params.DECIMALS = 4
|
||||
|
||||
paramsArray.push(params)
|
||||
|
||||
params = {}
|
||||
params.VALUE = currentRecord.balanceB;
|
||||
params.MIN_VALUE = currentRecord.minimunBalanceB
|
||||
params.INIT_VALUE = currentRecord.initialBalanceB
|
||||
params.MAX_VALUE = currentRecord.maximunBalanceB
|
||||
params.VALUE = record.variable_current_balance_quotedAsset;
|
||||
params.MIN_VALUE = record.variable_episode_parameters_minimum_balance_quotedAsset
|
||||
params.INIT_VALUE = record.variable_episode_parameters_initial_balance_quotedAsset
|
||||
params.MAX_VALUE = record.variable_episode_parameters_maximum_balance_quotedAsset
|
||||
params.ASSET_LABEL = 'Quoted'
|
||||
params.ASSET_NAME = currentRecord.quotedAsset
|
||||
params.ASSET_NAME = record.variable_episode_parameters_quotedAsset
|
||||
params.LEFT_OFFSET = X_AXIS
|
||||
params.POSITION_TAKEN = positionTaken
|
||||
params.BASE_ASSET = currentRecord.baseAsset
|
||||
params.BASE_ASSET = record.variable_episode_parameters_baseAsset
|
||||
params.DECIMALS = 2
|
||||
|
||||
paramsArray.push(params)
|
||||
} else {
|
||||
params = {}
|
||||
params.VALUE = currentRecord.balanceB;
|
||||
params.INIT_VALUE = currentRecord.initialBalanceB
|
||||
params.MIN_VALUE = currentRecord.minimunBalanceB
|
||||
params.MAX_VALUE = currentRecord.maximunBalanceB
|
||||
params.VALUE = record.variable_current_balance_quotedAsset;
|
||||
params.INIT_VALUE = record.variable_episode_parameters_initial_balance_quotedAsset
|
||||
params.MIN_VALUE = record.variable_episode_parameters_minimum_balance_quotedAsset
|
||||
params.MAX_VALUE = record.variable_episode_parameters_maximum_balance_quotedAsset
|
||||
params.ASSET_LABEL = 'Base'
|
||||
params.ASSET_NAME = currentRecord.baseAsset
|
||||
params.ASSET_NAME = record.variable_episode_parameters_baseAsset
|
||||
params.LEFT_OFFSET = X_AXIS
|
||||
params.POSITION_TAKEN = positionTaken
|
||||
params.BASE_ASSET = currentRecord.baseAsset
|
||||
params.BASE_ASSET = record.variable_episode_parameters_baseAsset
|
||||
params.DECIMALS = 4
|
||||
|
||||
paramsArray.push(params)
|
||||
|
||||
params = {}
|
||||
params.VALUE = currentRecord.balanceA;
|
||||
params.MIN_VALUE = currentRecord.minimunBalanceA
|
||||
params.INIT_VALUE = currentRecord.initialBalanceA
|
||||
params.MAX_VALUE = currentRecord.maximunBalanceA
|
||||
params.VALUE = record.variable_current_balance_baseAsset;
|
||||
params.MIN_VALUE = record.variable_episode_parameters_minimum_balance_baseAsset
|
||||
params.INIT_VALUE = record.variable_episode_parameters_initial_balance_baseAsset
|
||||
params.MAX_VALUE = record.variable_episode_parameters_maximum_balance_baseAsset
|
||||
params.ASSET_LABEL = 'Quoted'
|
||||
params.ASSET_NAME = currentRecord.quotedAsset
|
||||
params.ASSET_NAME = record.variable_episode_parameters_quotedAsset
|
||||
params.LEFT_OFFSET = X_AXIS
|
||||
params.POSITION_TAKEN = positionTaken
|
||||
params.BASE_ASSET = currentRecord.baseAsset
|
||||
params.BASE_ASSET = record.variable_episode_parameters_baseAsset
|
||||
params.DECIMALS = 2
|
||||
|
||||
paramsArray.push(params)
|
||||
|
||||
+12
-12
@@ -21,7 +21,7 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
|
||||
container.frame.containerName = "Simulation Current Position Panel";
|
||||
|
||||
let currentRecord;
|
||||
let record;
|
||||
let lastRecord;
|
||||
let upDownButton
|
||||
|
||||
@@ -54,7 +54,7 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
thisObject.onRecordChange = undefined
|
||||
thisObject.isVisible = undefined
|
||||
|
||||
currentRecord = undefined
|
||||
record = undefined
|
||||
lastRecord = undefined
|
||||
upDownButton = undefined
|
||||
}
|
||||
@@ -84,7 +84,7 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
|
||||
function onRecordChange(records) {
|
||||
|
||||
currentRecord = records.currentRecord;
|
||||
record = records.record;
|
||||
lastRecord = records.lastRecord
|
||||
|
||||
}
|
||||
@@ -112,7 +112,7 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
|
||||
function plotCurrentRecordInfo() {
|
||||
|
||||
if (currentRecord === undefined) { return; }
|
||||
if (record === undefined) { return; }
|
||||
|
||||
const frameBodyHeight = thisObject.container.frame.getBodyHeight();
|
||||
const frameTitleHeight = thisObject.container.frame.height - frameBodyHeight;
|
||||
@@ -133,32 +133,32 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
y = y + increment;
|
||||
printLabel('Size', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.positionSize, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(record.variable_current_position_size, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Rate', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.sellRate, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(record.variable_current_position_rate, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Stop', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.stopLoss, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(record.variable_current_position_stopLoss_value, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Take Profit', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.takeProfit, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(record.variable_current_position_takeProfit_value, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Periods', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.positionPeriods), X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel((record.variable_current_position_count_periods), X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Days', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.positionDays).toFixed(2), X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel((record.variable_current_position_stat_days).toFixed(2), X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
y = y + increment;
|
||||
@@ -167,12 +167,12 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
y = y + increment;
|
||||
printLabel('Profit / Loss', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.lastTradeProfitLoss), X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel((record.variable_last_position_profitLoss), X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('ROI', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.lastTradeROI).toFixed(2) + ' % ', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel((record.variable_last_position_ROI).toFixed(2) + ' % ', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
}
|
||||
}
|
||||
+16
-16
@@ -1,5 +1,5 @@
|
||||
|
||||
function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimulationPartialResultsPanel() {
|
||||
function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimulationEpisodePanel() {
|
||||
|
||||
let thisObject = {
|
||||
fitFunction: undefined,
|
||||
@@ -17,9 +17,9 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
container.initialize();
|
||||
thisObject.container = container;
|
||||
|
||||
container.frame.containerName = "Simulation Partial Results Panel";
|
||||
container.frame.containerName = "Simulation Episode Panel";
|
||||
|
||||
let currentRecord;
|
||||
let record;
|
||||
let lastRecord;
|
||||
let upDownButton
|
||||
|
||||
@@ -52,7 +52,7 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
thisObject.onRecordChange = undefined
|
||||
thisObject.isVisible = undefined
|
||||
|
||||
currentRecord = undefined
|
||||
record = undefined
|
||||
lastRecord = undefined
|
||||
upDownButton = undefined
|
||||
}
|
||||
@@ -82,7 +82,7 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
|
||||
function onRecordChange(records) {
|
||||
|
||||
currentRecord = records.currentRecord;
|
||||
record = records.record;
|
||||
lastRecord = records.lastRecord
|
||||
|
||||
}
|
||||
@@ -110,7 +110,7 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
|
||||
function plotCurrentRecordInfo() {
|
||||
|
||||
if (currentRecord === undefined) { return; }
|
||||
if (record === undefined) { return; }
|
||||
|
||||
const frameBodyHeight = thisObject.container.frame.getBodyHeight();
|
||||
const frameTitleHeight = thisObject.container.frame.height - frameBodyHeight;
|
||||
@@ -126,52 +126,52 @@ function newTradingEnginesPlottersTradingSimulationTradingSimulationTradingSimul
|
||||
|
||||
y = y + increment;
|
||||
y = y + increment;
|
||||
printLabel('Partial Results', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel('Episode', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Profit / Loss', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.profit, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(record.variable_episode_stat_profitLoss, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Trades', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.roundtrips, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(record.variable_episode_count_positions, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Hits', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.hits, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(record.variable_episode_count_hits, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Fails', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.fails, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(record.variable_episode_count_fails, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Hit Ratio', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.hitRatio * 100).toFixed(2) + ' %', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel((record.variable_episode_stat_hitRatio * 100).toFixed(2) + ' %', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('ROI', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.ROI * 100).toFixed(2) + ' %', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel((record.variable_episode_stat_ROI * 100).toFixed(2) + ' %', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Periods', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.periods, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(record.variable_episode_count_periods, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Days', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel(currentRecord.days, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel(record.variable_episode_stat_days, X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
y = y + increment;
|
||||
printLabel('Anualized Rate of Return', X_AXIS, frameTitleHeight + frameBodyHeight * y, '0.60', undefined, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
y = y + increment;
|
||||
printLabel((currentRecord.anualizedRateOfReturn * 100).toFixed(2) + ' %', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
printLabel((record.variable_episode_stat_anualizedRateOfReturn * 100).toFixed(2) + ' %', X_AXIS, frameTitleHeight + frameBodyHeight * y, '1.00', 14, undefined, true, thisObject.container, thisObject.fitFunction);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user