SMA Example
Add a simple moving average as a price overlay.
Code
tsx
import 'react-candlesticks/style.css';
import {
Candlesticks,
Chart,
Panel,
SMA,
exampleData,
} from 'react-candlesticks';
export default function App() {
return (
<div style={{ width: '100vw', height: '100vh' }}>
<Chart data={exampleData} granularity="d1" theme="dark">
<Panel heightRatio={3}>
<Candlesticks />
<SMA period={20} />
</Panel>
</Chart>
</div>
);
}