Hourly stock signals routed from TradingView to Alpaca
Automating a Heikin Ashi TradingView Stock Strategy on Alpaca
Heikin Ashi makes market movement look calmer by blending each candle with previous price information. That smoother picture can make trend changes easier to read, but it can also make a historical strategy appear more executable than it really was.
A smooth chart can be useful and dangerous for exactly the same reason: it hides part of the noise. Heikin Ashi makes the direction easier to see, but historical orders can also appear to enter and exit at synthetic prices that never existed in the real order book.
The protected Buy and Sell Signals using EMA, Stochastic and Pivots strategy was published by mmsrect for short-term stock trading.
The publisher describes it as a selective system designed to produce fewer but more accurate signals and states that it works best on hourly stock charts when the broader trend is rising.
This recorded experiment uses Apple Inc. on a one-hour NASDAQ chart. TradingView generates the strategy orders and AlgoWay routes them to an Alpaca account.
The displayed test was calculated on a non-standard Heikin Ashi chart. Heikin Ashi candles contain synthetic OHLC values created from averages. Those values are not necessarily prices available for a real stock order.
TradingView itself warns that strategies tested on non-standard chart types can produce unrealistic results. An attractive fill on a Heikin Ashi candle may be impossible to reproduce through Alpaca because Alpaca executes against actual market prices.
The displayed profit, win rate, profit factor and drawdown should therefore be treated as a record of the synthetic-chart experiment, not as a verified expectation for live execution.
Standard candlestick test
Apply the strategy to normal candles and run the full historical period again. Signals and results may change because the strategy now reads standard OHLC data.
Standard OHLC order fills
When available, enable Fill orders on standard OHLC in Strategy Properties. Signals remain based on Heikin Ashi, while simulated fills use standard candle prices.
Alpaca paper forward test
Run the alert through Alpaca paper trading and compare real-time market fills with the signals generated by the Heikin Ashi chart.
Heikin Ashi is a smoothing lens, not an exchange price feed
A normal candlestick reports the actual open, high, low and close for its interval. Heikin Ashi recalculates those values using current and previous candle information.
The result behaves like a noise-reducing lens. Consecutive bullish or bearish candles become easier to recognize, and small interruptions inside a broader movement are visually reduced.
A smoother candle body can help identify market structure, but the synthetic open or close should not automatically be treated as a price at which a broker could have filled an order.
This distinction is especially important in automated trading. The TradingView chart decides when the signal exists, while Alpaca decides whether and where the order can actually execute.
EMA, Stochastic and pivots perform different jobs
The full source code is protected, so the exact private conditions cannot be audited. The published components still reveal the intended structure of the strategy.
EMA supplies the slope
An exponential moving average responds more strongly to recent prices than an equally weighted average. It can provide context about whether the current stock movement is rising or falling.
Stochastic measures position inside the range
Stochastic compares the latest price with the recent high-low range. It helps identify when movement has approached an extreme relative to its recent history.
Pivots mark structural reaction zones
Pivot logic identifies local turning areas. These levels can help distinguish a random oscillator movement from a reaction occurring near an important price structure.
The three components resemble navigation instruments inside a moving vehicle. EMA shows the direction of the road, Stochastic reports how far the vehicle has moved toward one edge of its recent lane, and pivots mark intersections where direction previously changed.
Because the script is protected, the article does not claim which component has final authority or reproduce private entry formulas that are not publicly visible.
The strategy is designed for stocks already moving upward
The publisher states that the system works best on hourly stock charts in an uptrend. This gives the strategy a directional purpose rather than presenting it as a universal market detector.
In a rising stock, a temporary Stochastic decline can represent a pullback inside a larger advance. A pivot reaction and a renewed trend signal may then provide a continuation entry.
In a broad decline, the same oscillator movement can be only a pause before the next downward leg. Trend context changes the meaning of the signal.
Its stated purpose is not to predict every market bottom. It attempts to participate selectively when short-term conditions align with a stronger upward stock structure.
An hourly chart does not guarantee frequent trading
One-hour candles normally belong to intraday or day-trading workflows. They can react within the US market session and offer more opportunities than daily or weekly candles.
The displayed test completed 120 trades from January 2020 through July 2026. That represents roughly one to two completed trades per month.
Not a scalping rhythm
Scalping normally requires many decisions from low-minute charts. This strategy produced a much smaller number of accepted setups.
Selective hourly intraday trading
Signals can form during the trading day, but the EMA, Stochastic and pivot filters reduce the number of situations that become orders.
Possible swing overlap
A position can remain open after the market session if the strategy does not generate a closing condition before the bell.
Automation is valuable here not because signals arrive every few minutes, but because the trader may need to monitor hundreds of hourly candles while waiting for one valid setup.
The displayed metrics look exceptional but capital growth was tiny
The Strategy Tester period runs from January 2, 2020 through July 24, 2026. The simulation begins with 100,000 USD, uses 10% of equity per strategy order and executes on the completed candle.
Eighty-four of the 120 displayed trades were profitable. Thirty-six were unprofitable.
A displayed profit factor of 6.706 means recorded gross profit was more than six times recorded gross loss inside this Strategy Tester report.
The total historical gain was nevertheless only 271.15 USD, or 0.27% of the initial capital, across more than six years.
The strategy can display a strong relationship between winning and losing trades while still producing very little total profit. The Heikin Ashi fill limitation also means the relationship must be rechecked using real prices.
Maximum drawdown is displayed as only 27.92 USD, or 0.03%. That unusually small value is another reason to validate the complete result on standard OHLC data.
Creating the Alpaca paper route in AlgoWay
Start with Alpaca paper trading. Paper credentials and live credentials belong to separate environments, so the API Mode selected in AlgoWay must match the generated key pair.
Open Dashboard >> Trade Webhooks and create a route with TradingView as the source and Alpaca as the destination.
| Webhook field | Recommended first setup | Purpose |
|---|---|---|
| Platform | Alpaca | Selects the Alpaca Trading API connector. |
| API Mode | Demo | Routes the initial tests to the Alpaca paper environment. |
| API Key | Your paper API key | Identifies the selected paper account. |
| API Secret | Your paper API secret | Authenticates the Alpaca order request. |
| Quantity Multiplier | Absolute 1 | Does not intentionally scale the TradingView quantity. |
| News Filter | No or your own policy | Determines whether configured news events may block an order. |
The complete account and webhook procedure is documented in TradingView Alerts to Alpaca Webhook Automation with AlgoWay .
The first paper order verifies the execution road
Open Dashboard >> Webhook Logs, click Test Webhook and choose the Alpaca Demo route.
Use a supported stock ticker and one share or another deliberately small test quantity.
It checks only the API mode, credentials, symbol, quantity and Alpaca response. EMA, Stochastic, pivots and synthetic candles are not involved.
Confirm the request in AlgoWay Webhook Logs and inspect the resulting position in the Alpaca paper account before connecting the TradingView alert.
The TradingView alert sends the completed strategy state
Create an alert from the strategy order fills and place this one-line JSON in the Message field:
{"platform_name":"alpaca","ticker":"{{ticker}}","order_contracts":"{{strategy.order.contracts}}","order_action":"{{strategy.market_position}}","price":{{close}}}
{{ticker}}
Inserts the stock symbol from the current TradingView chart.
{{strategy.order.contracts}}
Inserts the share quantity attached to the executed strategy order.
{{strategy.market_position}}
Inserts the resulting long, short or flat TradingView strategy state.
{{close}}
Inserts the chart close available when the alert fires. On a Heikin Ashi chart, this can be a synthetic value and must not be treated as the guaranteed Alpaca fill price.
Open Notifications, enable Webhook URL and paste the private URL generated by the AlgoWay Alpaca route.
TradingView stores a server-side copy of the strategy when the alert is created. After changing the chart type, strategy settings or Strategy Properties, delete the old alert and create it again.
Compare the Heikin signal with the real Alpaca fill
The first autonomous order should be examined as a price comparison experiment, not merely marked successful because a position appeared.
- Record the Heikin Ashi signal. Note the synthetic chart close, strategy direction and calculated quantity.
- Read AlgoWay Webhook Logs. Confirm the ticker, action, contracts and complete Alpaca response.
- Inspect the Alpaca fill. Record the actual market execution price received by the paper account.
- Measure the difference. Compare the synthetic TradingView reference with the actual Alpaca fill and repeat the process across multiple orders.
This comparison reveals whether the visually smooth strategy still behaves acceptably when its signals meet real market prices.
The complete Heikin Ashi stock workflow
What this Alpaca automation experiment establishes
EMA supplies trend context, Stochastic measures position inside the recent range and pivot logic identifies areas where price structure has changed.
The publisher designed the protected strategy for selective hourly trading in stocks already moving upward. The displayed test produced only around one or two completed trades per month.
Its Strategy Tester report shows a 70% win rate and profit factor of 6.706, but total profit reached only 0.27% across more than six years.
More importantly, those figures were calculated on Heikin Ashi candles. Their synthetic prices cannot be treated as evidence that Alpaca could reproduce the same entries, exits or drawdown.
The responsible workflow is to verify standard OHLC fills, run the complete route in Alpaca paper mode and compare every synthetic signal with the real market execution recorded by the destination.
Original strategy: Buy and Sell Signals using EMA, Stochastic and Pivots . Alpaca connection manual: TradingView Alerts to Alpaca Webhook Automation . Heikin Ashi warning: TradingView guidance for non-standard chart backtesting .
Direct answers
Direct answers about Heikin Ashi stock automation on Alpaca
Can a Heikin Ashi TradingView stock strategy be automated on Alpaca?
Yes. TradingView can generate strategy order alerts from a Heikin Ashi chart and send them through an AlgoWay webhook to an Alpaca paper or live account. The strategy must still be tested using realistic market fills before live automation.
Why can a Heikin Ashi backtest be unrealistic?
Heikin Ashi candles use synthetic open, high, low and close values calculated from averages. Those values are not necessarily prices at which an Alpaca stock order could have executed.
What does Fill orders on standard OHLC do?
It allows the strategy to continue calculating signals from the Heikin Ashi chart while the TradingView broker emulator fills historical orders using standard market OHLC values.
Which indicators does this stock strategy use?
The published strategy combines an exponential moving average, Stochastic and pivot levels. The EMA provides trend context, Stochastic measures price location inside its recent range and pivots identify important reaction areas.
Is the strategy source code available?
No. The TradingView script is protected and its complete internal conditions cannot be independently inspected. It can still be used on a chart and tested through strategy alerts.
Is an hourly stock strategy considered day trading?
An hourly stock strategy usually belongs to slower intraday trading. Because this test produced only around one or two completed trades per month, its practical rhythm also overlaps with short-term swing trading.
Why does the strategy focus on stocks in an uptrend?
The publisher states that the strategy works best on hourly stock charts in an uptrend. Trend context can help prevent every temporary Stochastic movement from being treated as an independent reversal.
Does a 6.706 profit factor mean the strategy is highly profitable?
Not by itself. Profit factor compares recorded gross profit with recorded gross loss. The displayed report had a high profit factor but produced only 0.27 percent total profit across more than six years.
Should the final Alpaca alert use a fixed share quantity?
No. A fixed quantity is suitable for the initial paper connection test. The final strategy alert should use {{strategy.order.contracts}} so TradingView supplies the strategy quantity.
What results are displayed in the Heikin Ashi report?
From January 2, 2020 through July 24, 2026, the displayed TradingView report shows 271.15 USD profit, a profit factor of 6.706, 84 profitable trades out of 120 and maximum drawdown of 27.92 USD. These figures require standard-price verification because the chart uses Heikin Ashi.