V20 Strategy by davidjosephind

By davidjosephind

Performance Metrics

Description

Core concept: This strategy trades the "V20" pattern, a run of consecutive green candles that gains at least 20% (configurable) from the low of the run to the high, followed by a pullback entry near the run's base.Pattern detection:- Counts consecutive green candles (close > open, or close == open with open > previous low)- Once a run ends (a red candle appears), it checks whether that just-finished run gained at least `minGainPct` (default 20%) from its lowest low to its highest high, and lasted at least `minRunLen` candles (default 2)- If both conditions are met, a signal fires on the last green candle of that runEntry logic:- Places a limit buy order at the base (lowest low) of the qualifying run, sized using a fixed cash amount per trade (`cashPerTrade`, default 10,000) rather than a percent of equity, so quantity is always calculated the same way regardless of how many trades are open- Pyramiding is set very high (1000) and every signal creates a brand new, independently tracked trade with its own ID, so multiple pending or open V20 setups can exist at once without blocking each otherExit logic:- Each filled trade exits with its own limit order at the top (highest high) of its run, using an explicit quantity so it can only close its own position- Pending (unfilled) orders never expire or get invalidated. They stay live indefinitely until price pulls back to the base and fillsDMA filter:- Optionally requires the run's base to be below a moving average (default 200-period SMA) before a trade is allowed- A built-in exempt list of large-cap/blue-chip NSE tickers skips this DMA check entirely- A manual override dropdown lets you force the DMA filter on or off for all stocks, ignoring the exempt listVisuals:- Plots the DMA line- Gray triangle marks a valid V20 pattern that got filtered out by the DMA rule- Green triangle marks a valid V20 pattern that actually resulted in a trade- Once a trade fills, it draws dashed BUY/TARGET lines and labels at the base and top prices, extending forward while the trade is openStats table: Shows open trade count, closed trade count, average bars held, and average profit per closed trade, updated on the last bar.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView