← Script Marketplace
Open-source scriptindicator/v1

Center of Gravity

by Kodexius·@kodexius·

Use a weighted price window to form a bounded, low-lag momentum oscillator.

#center-of-gravity#momentum#oscillator
Center of Gravity chart preview

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
Release notes

Initial classic indicator release.

View current source ↓
Source codempl-2.0View 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

Loading…

No comments yet. Start the discussion.