simulationState

This commit is contained in:
Luis Fernando Molina committed 2020-06-06 13:14:18 +02:00
1 parent 0fbe3f1ce5
commit 3b7310dc5b
5 files changed
+38 -91

No files matched your search

+13
View File
@@ -812,5 +812,18 @@ exports.newTradingSystem = function newTradingSystem(bot, logger) {
if (value === undefined) return { DEFAULT_VALUE }
return value
}
function isItInside(elementWithTimestamp, elementWithBeginEnd) {
/*
The function is to allow in Conditions and Formulas to easily know when an element with timestamp (like the ones of single files) are inside the time range
of an element with a time range, like a candle.
*/
if (elementWithTimestamp.timestamp >= elementWithBeginEnd.begin && elementWithTimestamp.timestamp <= elementWithBeginEnd.end) {
return true
} else {
return false
}
}
}