Hoplite Vanguard Software Turns Daily Prices Into Trading Signals

Hoplite Vanguard is a desktop tool for exploring stock prices and trading signals, and has been developed by Hoplite Analytics. It is currently not publicly available for download but the content of this post constitutes a presentation of its capabilities.

Highlights:

  • The Sharpe calculation compares mean daily return with return volatility.
  • The program flags moving-average crossovers and 16 candlestick patterns.
  • The desktop chart overlays those signals and an optional regression tunnel.

Building the Daily Price History

Hoplite Vanguard workflow showing how daily prices feed Sharpe ratio, moving-average, and candlestick calculations before appearing on a desktop chart with an optional regression tunnel.

The workflow from daily data download to the desktop chart.

From the Watchlist to the Database

The process starts with a list of ticker symbols and company names. The program requests daily history for each symbol and writes the returned observations to a separate SQLite table for that ticker. The subsequent analysis steps then use the stored history, and the desktop app can load one ticker at a time.

What a Daily Price Row Contains

A row in the SQLITE database represents one trading session. The open and close are the prices at the start and end of the session. The high and low are the extremes reached during it, and volume is the number of shares traded. Those four price fields give the candlestick detector the geometry of each session.

Adjusted close puts historical closing prices on a comparable basis by accounting for corporate actions such as stock splits and cash dividends. Hoplite Vanguard uses the adjusted-close field for daily returns, moving averages, the price line, and the regression fit.

Calculating the Indicators

A batch run works through the stored price history for each ticker. It calculates a single Sharpe value, then builds dated records of moving averages, crossovers, and candlestick patterns.

Screenshot of the Hoplite Vanguard desktop application interface featuring a Goldman Sachs stock chart in USD with a regression tunnel and moving average lines.

The Sharpe Ratio and Return Volatility

The Sharpe ratio compares the average return above a benchmark with the variability of that difference. The denominator measures how widely those excess returns vary around their mean. Hoplite Vanguard sets the benchmark risk-free rate to zero, so the daily returns themselves are the excess returns used in its calculation.

For a historical example from currency markets regarding the importance of volatility as such, see how the Colombian peso fluctuated against the U.S. dollar.

Calculating Daily Returns From Adjusted Close

For trading session t, the program compares that session’s adjusted close with the adjusted close from the previous trading session. Dividing the current price by the previous price gives a ratio. Subtracting one expresses the change as a fraction of the previous price.

rt = Pt ÷ Pt−1 − 1

The result is the daily return for session t. P denotes the adjusted close. If the adjusted close rises from 100 to 102, the daily return is 102 ÷ 100 − 1, or 2%. The first price row has no previous close to compare, so the return series starts with the second row. The same percentage-change calculation is used to map daily market-index moves with Python and QGIS in another Hoplite Analytics project.

The Sharpe Formula Used in Hoplite Vanguard

The program divides the mean daily return by the sample standard deviation of daily returns and multiplies by the square root of the number of price rows.

Sharpe ratio = √N × (r̄ ÷ sr)

In the formula, the bar over r denotes the mean daily return, s denotes standard deviation, and N counts the price rows. For 400 price rows, a mean daily return of 0.10%, and a daily standard deviation of 1.25%, the displayed value is 1.60.

Cropped screenshot of the Hoplite Vanguard header displaying the Nvidia status bar with a Sharpe Ratio of 4.206 and a green uptrend arrow.

Moving Averages and Crossover Signals

A simple moving average gives each price in a rolling window equal weight. A 10-session average adds the latest 10 adjusted closes and divides by 10. The next session adds a new price and drops the oldest one. A longer window gives each new observation less weight, so a single day’s move has less effect on the average.

Hoplite Vanguard calculates averages over 10, 50, 40, and 200 sessions. It compares 10 with 50 and 40 with 200. An upward flag appears when the shorter average becomes higher than the longer one. A downward flag appears when the longer average becomes higher. For example, if the 10-session line moves from below the 50 session line to above it, the chart can mark that session as an upward 10/50 crossover.

Turning Candlestick Shapes Into Rules

A candle’s body spans the open and close. The upper wick runs from the top of the body to the high, and the lower wick runs from the bottom of the body to the low. A close above the open gives the candle a bullish body. A close below the open gives it a bearish body. Across sessions, gaps and the relative positions of candle bodies provide additional conditions.

The detector turns those relationships into checks on each row or sequence of rows. Some rules also compare the close with a short moving average to establish price context. The morning star, evening star, and three methods patterns are marked on their first candle in the historical view. Their later candles are required to confirm the sequence.

Close-up of the Hoplite Vanguard control panel featuring checkboxes for candlestick patterns and moving average crossovers, with a highlighted Regression Tunnel button.

Hammer

The body occupies at most 35% of the session’s range. The lower wick must be more than twice the body, while the upper wick must be shorter than half the body. The close must be below the previous 10-session moving average of closing prices.

Inverted Hammer

The shape puts the long wick above the body. The body must be less than 30% of the range, the upper wick more than twice the body, and the lower wick less than a tenth of the body. The program looks for a close below its 10-session average.

Bullish Engulfing

The first candle is bearish and the second is bullish. The second opens at or below the first close and finishes at or above the first open. That places the first body inside the second body.

Piercing Line

After a bearish candle, the next session opens below the first candle’s low and closes higher than its own open. The new close must rise above the midpoint of the first body while staying below its open.

Morning star

After a bearish candle, the second candle’s body must be less than half as large and its high must be below the first candle’s low. A bullish third candle completes the pattern by closing inside the first body and above its midpoint.

Three White Soldiers

The program looks for three bullish candles with successively higher closes. The second and third open inside the preceding body, so the rise is built across three sessions with overlapping bodies.

Hanging Man

The lower wick is more than twice the body, which occupies at most 30% of the session’s range. The upper wick is shorter than half the body. The close must be above the previous 10-session moving average, which gives the shape its upward price context.

Shooting Star

The session closes below its open and leaves a body no larger than 20% of the range. The upper wick is at least twice the body and the lower wick is at most a tenth of it. The close is above the previous 10-session average.

Bearish Engulfing

A bullish candle is followed by a bearish candle that opens above the first close and finishes below the first open. The second body spans the full first body.

Evening Star

After a bullish candle, the second candle’s body must be less than half as large and its low must be above the first candle’s high. A bearish third candle completes the pattern by closing inside the first body and below its midpoint.

Three Black Crows

Three long bearish candles close successively lower and leave short lower wicks. Each of the last two opens within the preceding body. The program also checks that the first candle’s close was above its short moving average.

Dark Cloud Cover

A bearish session opens above the previous bullish candle’s high. It then closes below the midpoint of that bullish body while staying above the previous session’s open.

Doji

The open and close nearly coincide. The body must be no more than 10% of the session’s range and no more than 0.1% of the absolute close. The session must also have a positive high-to-low range.

Spinning Top

The body is at most 30% of the range and each wick accounts for at least 30% of it. The upper wick must be between half and twice the lower wick. These checks pick out a small body between two substantial, roughly balanced wicks.

Rising Three Methods

In upward price context, a long bullish candle is followed by three smaller bearish candles that stay inside its high-to-low range. A fifth, bullish candle closes above the first candle’s close. The middle candles form the pause in the five-session sequence.

Falling Three Methods

In downward price context, a long bearish candle is followed by three smaller bullish candles inside its range. A fifth, bearish candle closes below the first candle’s close, completing the downward continuation pattern.

Combining Signals by Ticker and Date

The program matches candlestick flags to the moving-average records by date within each ticker. It keeps every moving-average row and attaches matching flags where available. The combined history gives the desktop app one dated series for plotting prices, crossovers, and pattern markers.

A separate console summary counts flags from the five latest sessions for each ticker. The Sharpe calculation produces one value per ticker for its available history, so it is stored separately and loaded alongside the daily signal history.

Reading the Desktop Chart

Screenshot of the Hoplite Vanguard desktop application interface featuring an Nvidia stock chart in USD, technical trading indicators, and a regression tunnel.

What Appears When You Select a Ticker

The app loads the ticker’s price and signal history, its saved Sharpe value, and company information. It plots adjusted close as a line. Selectable markers let you see any of the 16 candlestick patterns or four crossover types on the dates they were flagged. You can also show the 40- and 200-session moving averages alongside the price line.

For more on evaluating the business behind a ticker, see my review of Benjamin Graham’s The Intelligent Investor.

How the Regression Tunnel Is Drawn

The regression tunnel is an optional overlay fitted when the chart is drawn. It summarizes the direction and spread of prices over the part of the chart that follows the latest 40/200 crossover.

Close-up of a dark-themed stock chart featuring a white price line moving through a green and red linear regression channel.

Starting at the Latest 40/200 Crossover

The app finds the most recent upward or downward 40/200 crossover in the chart history. That date starts the fitting window, which runs through the latest available price. The chart’s trend label follows the direction of the crossover. The fitted slope is calculated separately from the prices in the window.

Fitting the Line and Measuring the Spread Around It

Hoplite Vanguard fits a straight line to adjusted close against date using least squares. This chooses the line that minimizes the sum of squared vertical differences between observed and fitted prices. Each difference is a residual.

The program calculates the standard deviation of the residuals across the fitting window. The upper band is two residual standard deviations above the line and the lower band is two below. If the fitted price on a date is 50 and the residual standard deviation is 2, the bands sit at 54 and 46. The gap between the bands is constant across the fitted window and widens when the prices are more spread out around their fitted line.

Johan Bengtsson

A group of colleagues celebrating a birthday at a co-working space that supports professionals doing business in Colombia.

Doing Business in Latin America – FDI Challenges

Lately, I've witnessed more and more the hurdles, risks, and challenges that people are facing when doing business in Latin ...
Learn how to report a crime in Colombia.

How to Report a Crime in Colombia

When in Colombia it may happen that you become victimized. We are going talk about how to report a crime ...
The hidden danger of common law marriage in Colombia.

The Danger of Common Law Marriage in Colombia

When doing entrepreneurship in Colombia, or in any other place for that matter, it is also important to keep in ...