El Salvador's ruling junta announced yesterday that it would nationalize all banks and put government controls on foreign trade, and implement a new agrarian program.

Junta member Col. Adolfo Majano said in a radio broadcast monitored in San Salvador by news agencies that the changes, which were pledged last month, were designed to bring peace to the country following a wave of political violence. Recently, leftist militants have seized the Spanish Embassy in San Salvador, as well as the Education Ministry and headquarters of the Christian Democratic Party.

A decree putting the changes into effect is expected to be issued by the military-civilian junta later this week.

Majano gave no details of the agrarian reform program. The nationalization is expected to affect about six Salvadoran banks and five foreign institutions, including branches of Citi-bank of New York and the Bank of America. The trade regulations will put all exports under the control of the government.

The announced reforms are the first substantive indication that the junta government, which took power following an Oct. 15 coup by young military officers, is prepared to move toward the left in order to forestall impending civil war. The coup overthrew the rightist military government of Gen. Carlos Romero.

The current junta is made up of two military officers, two Christian Democrats and one independent. The three civilians took office last month when three other civilians resigned, along with all but one Cabinet member, in protest of what they said was the military's failure to permit promised social, economic and political reforms.

Both the previous and current juntas have been paralyzed by inaction as remaining rightists within the military and within El Salvador's small, wealthy oligarchy said the reforms were too extreme, and leftist groups said they were not enough.

In the meantime, violence from cladestine paramilitary groups on the right, and guerrillas and other organizations on the left has increased.

About 70 members of the leftist Popular Leagues of Feb. 28 occupied the Spanish Embassy last Tuesday and continued to hold six hostages including Ambassador Victor Sanchez Meza. They have demanded the release of 16 comrades they say were jailed. Although 11 have been freed, the government has said it has no knowledge of the remaining five and has ordered an investigation.

About 20 hostages are being held in the Education Ministry, including Minister Eduardo Colindres, by other militants demanding free education in El Salvador, a nation of 5.5 million that is the poorest country in the continental Americas.

The Popular Leagues seized the headquarters of the Christian Democrats Jan. 28, in part as retaliation against the party for agreeing to become part of a reconstituted junta after members of other opposition groups has resigned. About 12 hostages are being held at the headquarters, and the militants there have demanded the release of political prisoners and a halt to what they say is government repression.