That doesn't work as that makes it as folder in the dock, and not a stack. If you click it then it opens in Finder. I want it to show the apps above the stack in the dock.
Another choice would be in your Dock Settings, where you can turn off "Show Recent Applications in Dock"
Those recently opened apps would disappear when you closed those apps.
Or, if you want to keep the icons in the dock - Right click on the dock icon, and choose Options/Keep in Dock. The icon then stays, and you can move it to your choice of location in the Dock (far from the right edge, correct?) Of course, you don't get to move folders much - always near the trash. I seldom, if ever, keep folders in the dock at all.
BTW, the folders on my dock will be near the bottom, because I prefer to have the dock on the right side of the screen (another choice)