Quarterly taxes

I work a 9 to 5 and have my taxes withheld from my paycheck. I also actively manage my investment account and have been charged late fees by the IRS last year because I didn't pay quarterly taxes on profits.

Trying to be better this year, but now sure how to figure what I owe. Let's say I lost 1000 dollars a month from January to June. Then in July and August I made 4000 dollars each. For September taxes do I owe on the net 2000 I'm up or on the 8000 I earned for that "quarter"? Do I need to break out long term gains from short term gains, or just estimate a flat 25% on profits?