If there is not a control valve associated with these ports and you only have a "Loop Back" hose connecting ports, its going to take a additional control valve in "circuit" with hoses going to ram on trailer (with quick disconnects).... Try exploring "Power Beyond" setups....
Your "flow" would be "PB" (Power Beyond from previous valve) and it generally goes to a "P" (Power port on downstream control valve) and the "return" is actually a "PB" (Power Beyond) to next control valve in line or if no other valve probably to "T" (Tank) or reservoir...
A picture of your "connectors" on tractor AND on trailer would be geat help for people trying to assist you in getting things setup.... It really helps to know what is available there..
Very rudimentary diagram whats probably involved...
To extend cylinder, pull handle away from valve. When handle is released, the valve spring centers to neutral stopping cylinder.
crossmfg.com