Open-source scriptindicator/v1
Center of Gravity
Use a weighted price window to form a bounded, low-lag momentum oscillator.
#center-of-gravity#momentum#oscillator
Description
The Center of Gravity oscillator compares weighted and unweighted sums across the selected window. It is designed to respond quickly to cyclical turning behavior and oscillates around a central level rather than following the price scale.
Open-source script. Everyone can inspect the source code, use the script on a chart, and save an editable copy.
Release notes
Version history · 1 published version
Version 1CurrentChart updatedCenter of Gravity · Aug 31, 2026
Source codempl-2.0View sourceHide source
indicator("Center of Gravity", { overlay: false });
const length = input.int("Length", 10, { min: 2, max: 200 });
const source = input.source("Source", "close");
plot(cog(source, length), { title: "COG", color: "#7c4dff", lineWidth: 2 });
hline(0, { title: "Zero", color: "#78909c", style: "dotted" });
Community discussion
0 comments
No comments yet. Start the discussion.