Strategy · Pine Script v6 · On the chart

STT Trade Plan Directional

by majohnst

This TradingView strategy detects directional trades on the price chart using multiple entry triggers including TMA-Crossing, Breakout, and VWAP-Crossing with price types like Close or Open.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code2,122
Settings40inputs
LicenceNone stated
Last update3 months ago1 Jul 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

STT Trade Plan Directional applies optional logical combinations of triggers and enforces time windows in ET for entries and daily closes. Additional settings control trade direction, position sizing, one-trade-per-day limits, and stop loss types. The strategy supports long, short, or both directions with fixed quantity and processes orders on close.

Details

Published by

majohnst on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Trend, Breakout, Mean reversion

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Script TitlestringSTT Trade Directional StrategyscriptName
Show label on chart?boolfalseshowLabel
Entry TypestringTMA-CrossingprimaryEntryType
Entry Type Addition Logical MethodstringoradditionalEntryTypeLogic
Price Trigger TypestringClosemainTriggerPriceType
Limit Only One Trade Per DayboolfalseoneSignalPerDay
Enable Daily ClosebooltruecloseDaily
Trade types allowedenumTradeDirection.LongtradeDirectionSelected
Hour (ET) to begin allowing trade entryint9dailyEntryWindowStartHour
Minutes after Hour to begin allowing trade entryint30dailyEntryWindowStartMinute
Hour (ET) to force daily trade exitsint15dailyExitWindowStartHour
Minutes after Hour to force trade exitsint30dailyExitWindowStartMinute
Show all 40 settings
SettingTypeDefaultVariable
Force Exit Buffer Minutesint15exitBufferMinutes
Allow Trading Alerts in Extended HoursboolfalseallowETH
Trigger Entry Enable Hour (ET)int9triggerHour
Trigger Entry Enable Minuteint45triggerMinute
Include Pre-Market HighboolfalseusePreMarketHigh
Max Float Size (M)float20.0floatSize
Volume Multiplierfloat1.0volumeMultiplier
Min Percent Gain (%)float25.0percentGain
Trade Entry Additional TypestringBreakoutadditionalEntryType
Entry Requires TMA bullish statebooltruetmaEntry_required
Entry Requires Price Above VWAPboolfalsevwapEntryRequired
Exit Requires Price Below VWAPboolfalsevwapExitRequired
Exit Requires TMA bearish statebooltruetmaExitRequired
Use Price Only (disables all others)boolfalsemanualPriceOnly
TMA trigger typeenumTmaTriggerType.CrossingtmaCrossingType
Primary Stop TypestringRange-BasedprimaryStopLossType
Stop Type Addition Logical MethodstringoradditionalStopLossTypeLogic
Additional Stop TypestringTMA-CrossingadditionalStopLossType
Primary Take Profit TypestringTMA-CrossingprimaryTakeProfitType
Additional Take Profit TypestringRange-BasedadditionalTakeProfitType
Take Profit $1 Range Start float0.07tpAmount
Use Range Based Stop/ProfitsbooltruerangeBased
Long starting value at $1float0.08rangeBasedInit
Short starting value at $1float0.12shortBasedInit
Trailing Stop (0.0=disabled)float0.07tsAmount
Trailing Stop Minimum Profitfloat0.05tsMinProfit
Stop Typestring$tsType
Limit to under $1000 close.booltruepriceAdjust
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

Traiversal A001

by ruckard
13 stars

Traiversal A001 is a breakout reversal strategy designed primarily for cryptocurrency trading. It identifies reversal entry opportunities three candles following a breakout and closes positions when a breakout in the opposite direction occurs. The script inclu

Strategy v5 BreakoutMean reversion
Updated 1 year ago · None stated GitHub repository of Traiversal A001
3 stars

Sapphire Fibonacci Strategies is a multi-mode strategy that combines Momentum Breakout, Mean Reversion, and Fibonacci Retracement models built on Fibonacci-period moving averages. It generates long and short trade signals based on price crossovers and moving a

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Sapphire Fibonacci Strategies
1 stars

This overlay strategy combines an AlphaTrend core with kinematic, Bayesian, and mean-reversion models, plus harmonic, classical, and candlestick pattern engines. It plots consolidation zones, volume-profile points of control, pattern lines, and forward forecas

Strategy v5 TrendCandlestick patterns Repaints
Updated today · None stated GitHub repository of JAT+BSM Pro Extended

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers