In the above example, the moving average lines display normally after zoom in.
The most important thing is to have sufficient data to compute the moving average. In your code, you are using 1920 session moving average. That means you need at least 1920 extra points. For example, if you want to display 200 session, you need to obtain data for at least 1920 + 200 = 2120 session so that we can compute the 1920 session moving average.
In the above sample code, the extraPoints are set to the maximum moving average (there are 2 moving averages in the above code):
int extraPoints = (m_avgPeriod1 > m_avgPeriod2) ? m_avgPeriod1 : m_avgPeriod2;
It then adjusts the startIndex backwards to include more data for the extraPoints.
// Add the extra points (adjust the extra points if there are insufficient data)
extraPoints = (std::min)(extraPoints, startIndex);
startIndex -= extraPoints;
For your case, please make sure the extraPoints are set to at least 1920, and the startIndex moves back by at least 1920 to obtain enough data points for the moving average.