Q. I was swimming on a late afternoon across a lake. I misjudged how long the swim will take and was cought far from the shore (about half an hour) when the shekiah was about to begin. Since I’m careful to daven always before the shekiah, I stopped and devened while I was floating vertically by just pedaling slowly with my feet. I was wearing a red cap (to be noticed by boats). Did I do the right thing?
Would it be correct if I was able to stand on the ground?

A. The Mishna (Brochos 22b) teaches that one who was immersing in a mikvah and realizes that the netz hachama is about to be, can cover himself with the water and read the shema. Shulchan Aruch (O.H. 44: 2) and Mishna Berura explain the details as to what is considered properly covered for the purpose of reciting brochos or reading the shema. However, there is no mention of being able to recite the amida while in the water. Although Megodim Chadoshim (Brochos p. 244) quotes that some understood that Biur Halocho (beginning of s. 58) includes tefila with krias shema, in regards to reading with the netz while immersed in the mikva, he maintains that such an opinion is highly unlikely.
Poskim quote Rabenu Yona (ibid.) that opines it is clearly not referring to tefila, that requires especial preparation and hachana, similar to one standing in front of a king (Pekudas Elozor (O.H. 58). Likewise is the opinion of the Meiri (Brochos 22b, see also Shito Achrono on Shito Mekubetzes ibid.).
Maane Lashon (O.H. 25) addresses indeed this shaila in regards a group of Bnei Torah that decided to daven mincha while bathing at the sea. Although, they were properly covered, he strongly objects the practice. Yet he agrees that after the fact, they did comply with the tefila, and they do not need to repeat the amida.
Horav Shlomo Miller’s Shlit’a opinion is similar. The Rov maintains that, in your case you should exit the water as fast as possible, cover properly and even a half an hour after the shekiah, daven two tefilos. You should express before you begin, that whichever is due first should indeed be so. (It could be mincha if it is still considered day followed by maariv, or the reverse, maariv first followed by tashlumin or repay for mincha, if it is already night).
The Rov maintains that the same applies, even if the waters were shallow enough to be standing while praying.

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit’a