diff --git a/Globals.js b/Globals.js index b458ec7bc..2377c57ae 100644 --- a/Globals.js +++ b/Globals.js @@ -134,6 +134,8 @@ if (testUser !== null) { LOGGED_IN_ACCESS_TOKEN_LOCAL_STORAGE_KEY = "access_token" } +const DEFAULT_FORMULA_TEXT = '// Write your formula here' + const USDT_BTC_HTH = 19900; // This is needed to know the scale of the market time line. const WIDHTER_VOLUME_BAR_BASE_FACTOR = 2.5; diff --git a/StrategySpace/Workspace/FunctionLibraries/PartsFromNodes.js b/StrategySpace/Workspace/FunctionLibraries/PartsFromNodes.js index 581a83c8a..e3719beac 100644 --- a/StrategySpace/Workspace/FunctionLibraries/PartsFromNodes.js +++ b/StrategySpace/Workspace/FunctionLibraries/PartsFromNodes.js @@ -391,7 +391,9 @@ function newPartsFromNodes () { function addFormula (node) { if (node.formula === undefined) { - node.formula = {} + node.formula = { + code: DEFAULT_FORMULA_TEXT + } createPart('Formula', '', node.formula, node, node) } } @@ -417,7 +419,9 @@ function newPartsFromNodes () { let m = phaseParent.phases.length let phase = { name: 'New Phase', - formula: {}, + formula: { + code: DEFAULT_FORMULA_TEXT + }, nextPhaseEvent: { situations: [] }