A martingale is a sequence of random variables X0,X1,…, of bounded expectation such that for every i≥0,
E[Xi+1∣X0,…,Xi]=Xi.
More generally, a sequence of random variables Z0,Z1,… is a martingale with respect to the sequence X0,X1,… if for all n≥0 the following conditions hold:
Zn is a function of X0,…,Xn,
E[∣Zn∣]<∞,
E[Zn+1∣X0,…,Xn]=Zn.
See these notes
https://en.wikipedia.org/wiki/Martingale_(probability_theory)