This paper reports on an expert advisor for forex trading based on Back Propagation Neural Network (BPNN) in MetaTrader4 platform. A single hidden layer feedforward network was established for foreign exchange rate prediction. Trading rules based on the prediction results was designed and realized. Finally, we optimized the parameters according to the profitability performed on EUR/USD, GBP/USD currency pairs separately. The optimized results are able to achieve good results in the training series. In the test series, the strategies are consistently profitable for at least the first twenty days. It is concluded that the BPNN based model do have the ability to make profits from the experimental currency pairs for the period investigated.