Initial commit

This commit is contained in:
Yaser
2026-08-13 20:18:11 +03:30
commit b676ac6288
70 changed files with 8810 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
/** ponytail: assert TV resolutions map 1:1 to Dena periods (no 180→240 / 480→720). */
const assert = require("assert");
const { tradingViewResolutionToDena } = require("../src/lib/mapOhlcv");
const cases = [
["60", 60],
["120", 120],
["240", 240],
["360", 360],
["720", 720],
["1D", 1440],
["D", 1440],
["d", 1440],
];
for (const [res, period] of cases) {
assert.strictEqual(
tradingViewResolutionToDena(res),
period,
`${res}${period}`
);
}
// Fake intervals must NOT silently alias to a different bucket.
assert.strictEqual(tradingViewResolutionToDena("180"), 180);
assert.strictEqual(tradingViewResolutionToDena("480"), 480);
console.log("ok: mapOhlcv TV resolutions");