Skip to content

Instantly share code, notes, and snippets.

@tiagosiebler
Created January 31, 2023 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiagosiebler/d25b297cd68b7560a631e7f66bc40905 to your computer and use it in GitHub Desktop.
Save tiagosiebler/d25b297cd68b7560a631e7f66bc40905 to your computer and use it in GitHub Desktop.
a = SUM(CLOSE>REF(CLOSE,1),n)/n*100;
function psychologicalLine(candles, n) {
let sum = 0;
for (let i = 0; i < n; i++) {
if (candles[i].close > candles[i - 1].close) {
sum++;
}
}
return sum / n * 100;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment