Moving averages backtest results: Why lines meet after the minute?


I was wondering why my back test results were usually negative and I found out why.
Look at the below image. There are three transactions happening.

What I want,
1. Buy at 5.00
2. Sell at 5.50
3. Buy at 5.35
Profit = 0.85.

But whats happening..
1. Buy at 5.65
2. Sell at 5.25
3. Buy at 5.65
Profit= -.80.

Why is this happening? Why the moving average line is crossing after every minute?

Pi is using candle to plot charts( They don’t know about something called Line charts). In technical analysis alerts generated only on candle close . That is what Pi follows. so the results.

1 Like

Thank you Peter,
But in live data, Can we expect the MA to adjust itself according to the intra-minute candle value or it will wait till the minute and calculates over the Close?