View on GitHub

OBV Direction with Moving Average Filter Strategy Diagram

Русский | 中文 | Español | Deutsch | Português | 日本語

On-Balance Volume adds the volume of every up candle and subtracts the volume of every down candle, so its slope says which side is doing the trading. This diagram reads only the slope, one candle at a time, and lets a simple moving average of price decide which slope is worth acting on. Despite the folder name, the signal compares OBV only with its value on the previous candle rather than with a breakout level.

schema

Strategy Overview

  • On-Balance Volume is calculated on finished candles and compared with its own value one candle back, which gives a plain rising or not rising verdict.
  • A twenty candle simple moving average of the closing price splits the chart into an upper half and a lower half and decides the direction of the entry.
  • An entry is made only from a flat position, so the two sides never fight each other inside one trade.
  • The exit needs no moving average: the position is given up as soon as the volume flow turns against it.

Entry and Exit Rules

  • Long entry: On-Balance Volume is above its value on the previous candle, the candle closed above the moving average and the position is flat. The order buys one lot at market.
  • Short entry: On-Balance Volume is at or below its value on the previous candle, the candle closed below the moving average and the position is flat. The order sells one lot at market. An unchanged OBV counts as not rising.
  • Exit: A long is closed on the first candle where OBV stops rising, a short on the first candle where OBV rises again, both through position modify blocks in close mode. There is no stop loss or take profit.

Parameters

Parameter Default Description
SMA Length 20 Averaging length of the simple moving average that decides the direction of the entry.
Volume 1 Order volume, in lots.
Candles 00:05:00 Candle time frame the whole diagram works on.

Diagram Details

  • The candle block feeds the On-Balance Volume block, the moving average block and the converter that reads the closing price; a previous value block delayed by one candle supplies the earlier OBV, and two comparison blocks turn the pair into a rising and a not rising flag.
  • Each logical AND joins the OBV flag, the position of price against the moving average and the flat position check, then triggers a position modify block set to open only.
  • The same two OBV flags are wired straight into the closing blocks, which are set to close mode and therefore stay idle while the diagram is flat.
  • The diagram runs on five-minute candles from the packaged history and trades every qualifying signal.

Usage

Import the .json file into Designer, run it in the backtester on historical data, then adjust the parameters or the blocks themselves to fit your instrument before trading it live.