An algebraic Hamiltonian vector field with a finite number of periodic orbits(1) Edit:  The previous version of this question contained 2 part. In this new version, I deleted the first part and move it to a new question.
Is  There  a polynomial Hamiltonian $H(x,y,z,w)=zP(x,y)+wQ(x,y)$, such that the corresponding Hamiltonian vector field in $\mathbb{R}^{4}$ has  at least one periodic orbit and the total number of periodic orbits is finite?
The motivation for this question  is that, for such particular Hamiltonian, the first two components of $X_{H}$
is  a polynomial planar vector field on the $x-y$ plane. On the other hand, a generic algebraic vector field on $\mathbb{R}^{2}$ has only a finite number of periodic orbits.
By non trivial periodic orbit, I mean, a periodic solution which minimum period is non zero.(That is a periodic orbit not a singular point).
 A: Answer to part two: No - this cannot be - even if you relax the conditions and only assume the vector field to be smooth.
Indeed, the question can be generalized somewhat: let $X : N \to TN$ be any smooth vector field on a manifold $N$. Then we may define a Hamiltonian
$H : T^*N \to \mathbb{R} \qquad$ by $\qquad H(q,p)=p(X_q)$.
Here $T^*N$ denotes the cotangent bundle (which has a canonical symplectic structure), and hence it makes sense to evaluate a cotangent vector $p \in T^*_qN$ on a vector in $T_qN$. This generalizes your second question with $X(x,y)=(Q(x,y),P(x,y))$ and $N=\mathbb{R}^2$.
The flow of the associated Hamiltonian vector field $X_H$ has flow $\Phi_t$ the same as the flow $\varphi_t$ of $X$ but lifted to the unique symplectomorphism, which is linear in $T_q^*N \to T^*_{\varphi(q)}N$. This is also given as:
$\Phi_t(q,p)=(\varphi_t(q),p\circ (D_q\varphi_t)^{-1})$
Indeed, if you (in local coordinates on $N$ - so we are now back in $\mathbb{R}^{2n}=T^*\mathbb{R}^n$) differentiate this w.r. to $t$ at $t=0$ you get the vector field:
$(X_q,-p \circ (\nabla X)_q)$
This is (up to a sign) precisely equal to $J_0\nabla H$.
Consequences of this are: Any periodic orbit (i.e. a fixed point $(q,p)=\Phi_T(q,p)$ must project to a similar orbit for $X$, and have: $p=p \circ (D_q\varphi_T)^{-1}$. This means that any eigenvector with eigenvalue 1 for $D_q \varphi_T$ defines such an orbit - so if 1 is an eigenvalue there are infinitely many. Since this return map takes any vector tangent to the orbit to itself we have such an eigenvector.
About the first question: I doubt it: indeed, no orbit can be non-degenerate since these are stable (for fixed orbit time $T_0$) under pertubations - hence there must be one with period $T$ for each $T\in[T_0-\epsilon,T_0+\epsilon]$ close by (for small enough $\epsilon>0$).
A: I do not understand how this shows 'no, that no such flow exists'. But here is a tweak on this thinking that does yield a proof of no. Suppose $(\gamma (t), p(t))$ is periodic orbit upstairs with period $T >0$. Then $\gamma (t) = (x(t), y(t))$ is periodic downstairs with period $T$ and $(D_{\gamma(0)}\phi_T )^* p(T) = p(0)$ the latter equation being the necessary and sufficient condition that the lift of a periodic orbit downstairs of period $T$ be periodic upstairs. This condition is a linear condition on $p$! Hence for all $\lambda$ real the solutions with initial condition $(\gamma(0), \lambda p(0))$ are also periodic of  period $T$: there are infinitely many if there is one. [By either projectivizing the fiber of the cotangent bundle or by fixing energy you can get a 'yes' example. Take $\phi_t$ to have one hyperbolic limit cycle surrounding a single hyperbolic fixed point. Then the only periodic solution upstairs, modulo scaling of $p$, is the one projecting onto the limit cycle and having 0 momentum normal to the limit cycle.] 
