hey am new to coding and i was trying to create a simple renko chart indicator am kind stuck here can anyone give me ideas?

 
#property indicator_chart_window

extern int BrickSize = 10; // Brick size in pips

int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[],
                const double &open[], const double &high[], const double &low[], const double &close[],
                const long &tick_volume[], const long &volume[], const int &spread[])
{
    int limit;
    if (prev_calculated == 0) {
        limit = rates_total;
    } else {
        limit = rates_total - prev_calculated;
    }

    for (int i = 0; i < limit; i++) {
        double brickValue = BrickSize * Point;
        double openPrice = open[rates_total - limit + i];
        double highPrice = high[rates_total - limit + i];
        double lowPrice = low[rates_total - limit + i];
        double closePrice = close[rates_total - limit + i];
        double brickCount = (highPrice - lowPrice) / brickValue;
        double brickDirection = (closePrice > openPrice) ? 1 : -1;
        
        for (int j = 0; j < brickCount; j++) {
            double brickOpen = (brickDirection > 0) ? openPrice + j * brickValue : openPrice - j * brickValue;
            double brickClose = brickOpen + brickValue;
            double brickHigh = (brickDirection > 0) ? brickClose : brickOpen;
            double brickLow = (brickDirection > 0) ? brickOpen : brickClose;
            PlotBrick(brickOpen, brickClose, brickHigh, brickLow);
        }
    }

    return(rates_total);
}

void PlotBrick(double open, double close, double high, double low)
{
    // Use the ChartPlot() function to draw a rectangle on the chart representing the Renko brick.
}
 

Renko charts: https://www.mql5.com/en/search#!keyword=renko

Filter (left side) for Articles = code and explanation and CodeBase = pure code.

Copy, paste, and modify according to your ideas.

Bare in mind there is almost nothing that has not been coded for MT5 yet.

Reason: