With the exception of the House Oberon artillery, your main gun can only fire in a 90 degree arc in front of the ship. This is the primary factor to consider when shooting. If there's a dotted line coming out of your reticule, then that means the direction your gun is pointing does not line up with the crosshair and you will fire elsewhere.
Secondly, you need to factor in the travel time of the cannon; it's fast, but it's not an instant hit. If the target is moving, shoot where they will be, as opposed to where they are. This is a greater factor for long-range shots (which, all going well, all of yours should be).
Thirdly, some users of the artillery do not realize that you can zoom in. I'm not sure about PS4, but I know that on PC it's right click by default. Zooming in makes it a heck of a lot easier to hit distant targets.