Is drawing from -1 to 1 only option or there are features to align to resolution?

In opengl is to draw with cordiantes vertical -1 to 1 and horizontal 1 to -1 only way to place objects or is there way to do 2d relative to resolution?
I have tested some formulas to align lines relative to resolution and accuracy is 1 pixel mistake if 1920 pixels resolution and 1920 lines drawn.
So far i have divided 2 by resolution and then testing with small differeneces to find right spot so gpu draws lines with offset and no space between, this does not seem good way to do it , is there alternative to align drawings to pixels?

glOrtho(0.0f, windowWidth, windowHeight, 0.0f, 0.0f, 1.0f);

Note that the Y axis is switched so your Y0 is at the top of the screen and not OpenGL-like in the bottom.

It appears that solution was to define glOrtho(-40, 40, -40, 40, -1, 1);
And now if i divide 80 by resolution all pixels are aligned.
Probably bigger number more accurate but 40 is fine for 2d drawing.
If i divided 2 by resolution then it was unaccurate.

Thanks , got my graph generator decently going.