Widebody Transport
Situational Awareness
Conflict Airborne Conflict
Flight Crew Took Evasive Action
Airspace Structure; Human Factors
ATC cleared flight to climb to 17;000 feet. At approximately 16;300 ft; ATC instructed crew to expedite climb to 17;000 feet. Very shortly after leveling at 17;000 ft; we received a Descend RA due to traffic at 12 O'clock and 400 ft above. Pilot Flying (FO) disconnected the autopilot and initiated a descent following TCAS RA commands. Lowest altitude achieved was about 16;400 feet. As the RA traffic passed from right to left the TCAS gave a climb command due to another aircraft (operating VFR) at our 9 O'clock and at 16;500 feet. Pilot Flying initiated a climb to follow TCAS RA commands. Maximum altitude reached was approximately 17;600 feet.Due to airspace congestion; I believe ATC was attempting to 'squeeze' our flight between proximate traffic. Also; based on ATC communication with VFR traffic; I believe the aircraft at our 9 O'clock position was not doing what the controller expected. Apparently that aircraft was conducting aerial photography. [Suggest] reduce workload of Air Traffic Controller. VFR aircraft clearly communicating intentions to ATC while maneuvering in congested airspace.
[Report narrative contained no additional information.]
Air carrier flight crew reported receiving two advisories while leveling at 17;000 feet departing EWR. The first was a descend RA for traffic above followed by a second RA to climb for other traffic.