INNER CODE UNIT · JavaScript
getRandomInt
pegaltier/awesome-utils-dev · utils-script/tradingview-snippet.js:13
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function checkDialogOpened() {
const container = document.querySelector(
'[data-name="indicator-properties-dialog"]'
);
if (!container) {
throw new Error("open the backtest config box first");
}
}
async function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function step(paramPosition) {
// Shift + F6 to focus on the website