With the information given, for any strategy you might pick, there exists an instance of the game that makes this strategy awful. For example, suppose $n=2$. Let $i$ be the index of the good you buy at day $1$, and suppose that $p_i^3=p_i^2+\epsilon$ and that for all $j\neq i$, $p_j^3=p_j^2+N$ for small $\epsilon$ and very large $N$.

If you want the notion of "optimal strategy" to make sense, you need to give more information. For example, you could ask that the daily price increments follow a given probability law on $\mathbb R_+$.

Assuming you have done so, let $X^d$ be the price increment vector between days $d$ and $d+1$, seen as a random variable in $(\mathbb R_+)^n$. If the $(X^d)_{1\leq i\leq d}$ are independant, then your strategy is optimal. Without independence, this is not true.