A moving average reads each candle's close unless you say otherwise. In Studio you can choose another price of the candle, and you can move the line forward. Both are optional, and both work in the Indicator condition block, as an Indicator signal and in the condition exit. They work the same way in Backtest and in the Bot, and your indicator draws them on your chart and in your script.
Which price it reads
- The close. This is what an average reads when you leave the price empty.
- Halfway between the high and the low, often called HL2.
- The average of the high, low and close, often called HLC3.
- The average of the open, high, low and close, often called OHLC4.
- The average of the high, low and close, with the close counted twice, often called HLCC4 or the weighted close.
The ones with the high and low in them move more when a candle has a long wick.
Moving it forward
You can move an average forward by 1 to 100 candles. This is called a displaced moving average. Moved forward 3, the line on each candle is the value the average had 3 candles before. Leave it empty, or type 0, and it isn't moved.
A row still compares each candle's own close with the line. So "the close above it" means the close is above the moved line.
When a row compares one average with a second average, only the first one reads the price you chose and is moved. The second one reads the close and is not moved.
Which averages
The simple, exponential, weighted and Hull averages, and every other moving average except FRAMA, MAMA and the moving average channel, which read the high and low on their own.
When it has a value
A moved average waits the number of candles you moved it, on top of its own length. A row that needs more history than your warmup holds is refused when you put the strategy on an account.