PROTECTED SOURCE SCRIPT
BUY LOW, BUY MORE, SELL HIGH - MARKET FLOW STRATEGY-JTM

────────────────────────────────────────────────────────
BUY LOW, BUY MORE, SELL HIGH – MARKET FLOW STRATEGY (v594) – JTM
────────────────────────────────────────────────────────
Category: Quantitative Momentum & Liquidity Flow Strategy
Author: JTM
────────────────────────────────────────────────────────
An Adaptive Contrarian live trading strategy that scales into deep pullbacks,
rides liquidity waves, and locks profit automatically, using your TradersPost.io webhook.
────────────────────────────────────────────────────────
DESCRIPTION
────────────────────────────────────────────────────────
The "Buy Low, Buy More, Sell High" strategy combines value-based accumulation
with adaptive profit protection. It adds exposure on weakness (new lower lows
and confirmed liquidity support) and closes trades dynamically once a profitable
run-up retraces by a set percentage (default 13%).
It reconstructs multi-timeframe market structure
(Intraday → Daily → Weekly → Monthly → Yearly)
using synthetic OHLCs to avoid repainting, and integrates VWAP anchoring,
adaptive KAMA smoothing, RSI validation, and rolling lower-low tracking.
Contrarian strategies are difficult for the human to be easily comfortable with...
because but the results can be worth the wait. Believe that you truly want to Sell when everyone is buying and buy when everyone is almost done selling. Not vice-versa!
Forget about trying to time the market at the true top or the true bottom - just ride
the rolling waves and the profits will come ashore.
────────────────────────────────────────────────────────
CORE FEATURES
────────────────────────────────────────────────────────
• Non-repainting by design – only confirmed bars update persistent state
• Synthetic HTF OHLC construction avoids lookahead bias
• Adaptive trailing TakeProfit logic aims for (80–87% of peak profit retained)
• AI-like market flow dashboard with Bull/Bear liquidity dominance
• Dynamic rolling "Lowest Low" (LLL) detection and visualization
• Modular time detection and session alignment (New York market default)
• Optional Liquidity Dashboard with intraday/swing dual-mode analytics
1. Non-Repainting Architecture - Long side strategy. Not coded for short selling.
2. Works best on a 1hr/60m intraday chart with a 3hr higher Timeframe (strategy input)
3. Immediately Uncheck Show Trade Signals in the Strategy's Style Settings to eliminate
onscreen clutter
4. Market Liquidity Dashboard can be displayed by setting in the strategy's inputs.
5. You set a price range of stocks you wish to allow to trade when using an alert list.
6. You can set a preview period where gray TV trades alerts to Traderspost are withheld.
7. If you check "Do not LIVE sell any assets today" and update the alert, no Traderspost
8. As well as the Market Flow Dashboard, you can display a table of HLs, and LLs.
Trending stocks will display HLs and Vice Versa.
9. You can switch away from Big Rolling Waves Mode (default) to Intraday Short Moves mode
10. Default Big Wave Rolling Cycle is 120 bars (Recommended) 30,60,90,120 are typical.
(this affects the strategy profitability and choice of entry and exits).
11. Reference to FIFO is about the array size for the stored non-repainting HLs and LLs
12. Option to execute trades on unconfirmed bar is BETA. The strategy Only trades on
confirmed bars always, but I am wanting/hoping to eventually Take Profit on a
BIG ASS institutional candle, morning session bar when they occur.
(a new bar is unconfirmed, building, and tricky to code without
breaking the strategy's reliability). Use at your own risk.
────────────────────────────────────────────────────────
Technical Highlights
────────────────────────────────────────────────────────
• AI-inspired “Flow Confidence” through liquidity imbalance between Bull and Bear pressure.
• Adaptive KAMA smoothing for non-lag confirmation.
• Dynamic trailing take-profit computed as 80–87% of the highest profitable run-up.
• Non-repainting multi-timeframe framework (daily–weekly–monthly aggregation).
• LLL Table module for Lowest-Low progression and trend exhaustion.
• Market Flow Dashboard visualizing rolling liquidity dominance and delta pressure.
• Session-aware logic for intraday vs. swing operation.
• All logic has been tuned to peak performance that satisfies the TradingView Profiler.
• Strategy Buys again at a lower price instead of selling and taking a loss. Drawdown Peaks!
but this requires you configure TradingView Strategy Pyramiding orders to 2 or more
and % of equity.
(definitely is more $$ risky, potentially more profitable and might beat Buy and Hold profits)
See the chart above.
────────────────────────────────────────────────────────
WHY IT DOES NOT REPAINT (even thought the TradingView alert message says it might.)
────────────────────────────────────────────────────────
1. All trade, table, and OHLC updates occur only on `barstate.isconfirmed`
2. Synthetic HTFs are self-built without `lookahead` or future data
3. All arrays use `var` persistence to freeze past state
4. Trailing TakeProfit peak updates only on confirmed highs
5. No forward-referencing of real-time partial bars
────────────────────────────────────────────────────────
LIMITATIONS
────────────────────────────────────────────────────────
1. Heavy computation on long intraday histories (optimize `max_bars_back`)
2. Requires intraday chart resolution (1m–4h)
3. U.S. session defaults (09:30–16:00 ET); adjust for other exchanges
4. Arrays and tables consume memory – disable extra visuals if unneeded
5. Not for use with Crypto, Forex, or Futures.
6. Only to be used with Stocks/Tickers having volume data.
7. Live trading is coded for a TradersPost.io Webhook and a brokerage account. (IBKR)
────────────────────────────────────────────────────────
WARNINGS
────────────────────────────────────────────────────────
1. This is an Adaptive and Contrarian Trading strategy that scales into DEEP pullbacks,
rides long liquidity waves, and locks profit automatically.
2. Trades can have a long duration but are minimal. This is not a strategy that will
generate thousands of trades. It will save you on commissions to.
3. It does its best to limit losses and but I cannot guarantee it will work for
all assets, all the time. Market conditions vary. Tickers vary.
4. Use it with assets that you trust not to race to zero dollars.
5. Use this strategy with healthy tickers that have medium to high volatility.
6. To eliminate onscreen clutter, uncheck strategy settings/style/trade signals.
7. I use this strategy exclusively. TradingView alerts run for me 24/7 and ROBO trade.
but you should vet the system with manual trades signals it generates for yourself.
8. It does not prevent you from losing profits in after hours trading and Market News.
9. The BIG ASS new bar of opening candle is Not calculated into the stats until it is confirmed. Especially bothersome for me when its a big 10% down candle. You still need to watch the first 9:30 candle with your eyes. I recommend you watch liquidity at Open using a 1m timeframe.
10. This is a pro-grade coded strategy but is NOT a “Wall Street Quant grade.” strategy.
Institutions rely on:
• slippage models
• depth-of-book impact modeling
• latency simulation
• volume-weighted fills
• partial fills & queue priority
• order slicing (TWAP, VWAP, POV)
Pine Script cannot simulate the above.
11. This Pine Script strategy is market-internal (chart & volume) and for personal-use only. The code remains private to me.
12. To the full-time traders — my respect.
I live in the world of code, not charts, scalps, candles and screens,
so I engineered this 2500-line strategy to trade for me with un-emotional discipline, as you do.
If this strategy resonates with you, I provide it for you to use in the TradingView spirit of community. Backtested results are hypothetical and not indicative of future performance.
Nothing here constitutes investment advice.
Trading involves risk, and users must assume full responsibility for their trading decisions.
Remember, its not about making 'all' the money a stock theoretically could return as if you did a buy and hold many years ago - its about making good money as you navigate the waves of the stormy seas, and not sinking. It about making better trade decisions compared to the persons you are trading against. Have fun all the while making your money - work for you.
────────────────────────────────────────────────────────
“Be fearful when others are greedy, and be greedy when others are fearful.”
— Warren E. Buffett
“The stock market is a device for transferring money from the impatient to the patient.”
— Warren E. Buffett
True wealth grows through time, not reaction. A person sits in the shade today because
of a tree that somebody planted years ago.
— Warren E. Buffett
Happy Trading!
BUY LOW, BUY MORE, SELL HIGH – MARKET FLOW STRATEGY (v594) – JTM
────────────────────────────────────────────────────────
Category: Quantitative Momentum & Liquidity Flow Strategy
Author: JTM
────────────────────────────────────────────────────────
An Adaptive Contrarian live trading strategy that scales into deep pullbacks,
rides liquidity waves, and locks profit automatically, using your TradersPost.io webhook.
────────────────────────────────────────────────────────
DESCRIPTION
────────────────────────────────────────────────────────
The "Buy Low, Buy More, Sell High" strategy combines value-based accumulation
with adaptive profit protection. It adds exposure on weakness (new lower lows
and confirmed liquidity support) and closes trades dynamically once a profitable
run-up retraces by a set percentage (default 13%).
It reconstructs multi-timeframe market structure
(Intraday → Daily → Weekly → Monthly → Yearly)
using synthetic OHLCs to avoid repainting, and integrates VWAP anchoring,
adaptive KAMA smoothing, RSI validation, and rolling lower-low tracking.
Contrarian strategies are difficult for the human to be easily comfortable with...
because but the results can be worth the wait. Believe that you truly want to Sell when everyone is buying and buy when everyone is almost done selling. Not vice-versa!
Forget about trying to time the market at the true top or the true bottom - just ride
the rolling waves and the profits will come ashore.
────────────────────────────────────────────────────────
CORE FEATURES
────────────────────────────────────────────────────────
• Non-repainting by design – only confirmed bars update persistent state
• Synthetic HTF OHLC construction avoids lookahead bias
• Adaptive trailing TakeProfit logic aims for (80–87% of peak profit retained)
• AI-like market flow dashboard with Bull/Bear liquidity dominance
• Dynamic rolling "Lowest Low" (LLL) detection and visualization
• Modular time detection and session alignment (New York market default)
• Optional Liquidity Dashboard with intraday/swing dual-mode analytics
1. Non-Repainting Architecture - Long side strategy. Not coded for short selling.
2. Works best on a 1hr/60m intraday chart with a 3hr higher Timeframe (strategy input)
3. Immediately Uncheck Show Trade Signals in the Strategy's Style Settings to eliminate
onscreen clutter
4. Market Liquidity Dashboard can be displayed by setting in the strategy's inputs.
5. You set a price range of stocks you wish to allow to trade when using an alert list.
6. You can set a preview period where gray TV trades alerts to Traderspost are withheld.
7. If you check "Do not LIVE sell any assets today" and update the alert, no Traderspost
8. As well as the Market Flow Dashboard, you can display a table of HLs, and LLs.
Trending stocks will display HLs and Vice Versa.
9. You can switch away from Big Rolling Waves Mode (default) to Intraday Short Moves mode
10. Default Big Wave Rolling Cycle is 120 bars (Recommended) 30,60,90,120 are typical.
(this affects the strategy profitability and choice of entry and exits).
11. Reference to FIFO is about the array size for the stored non-repainting HLs and LLs
12. Option to execute trades on unconfirmed bar is BETA. The strategy Only trades on
confirmed bars always, but I am wanting/hoping to eventually Take Profit on a
BIG ASS institutional candle, morning session bar when they occur.
(a new bar is unconfirmed, building, and tricky to code without
breaking the strategy's reliability). Use at your own risk.
────────────────────────────────────────────────────────
Technical Highlights
────────────────────────────────────────────────────────
• AI-inspired “Flow Confidence” through liquidity imbalance between Bull and Bear pressure.
• Adaptive KAMA smoothing for non-lag confirmation.
• Dynamic trailing take-profit computed as 80–87% of the highest profitable run-up.
• Non-repainting multi-timeframe framework (daily–weekly–monthly aggregation).
• LLL Table module for Lowest-Low progression and trend exhaustion.
• Market Flow Dashboard visualizing rolling liquidity dominance and delta pressure.
• Session-aware logic for intraday vs. swing operation.
• All logic has been tuned to peak performance that satisfies the TradingView Profiler.
• Strategy Buys again at a lower price instead of selling and taking a loss. Drawdown Peaks!
but this requires you configure TradingView Strategy Pyramiding orders to 2 or more
and % of equity.
(definitely is more $$ risky, potentially more profitable and might beat Buy and Hold profits)
See the chart above.
────────────────────────────────────────────────────────
WHY IT DOES NOT REPAINT (even thought the TradingView alert message says it might.)
────────────────────────────────────────────────────────
1. All trade, table, and OHLC updates occur only on `barstate.isconfirmed`
2. Synthetic HTFs are self-built without `lookahead` or future data
3. All arrays use `var` persistence to freeze past state
4. Trailing TakeProfit peak updates only on confirmed highs
5. No forward-referencing of real-time partial bars
────────────────────────────────────────────────────────
LIMITATIONS
────────────────────────────────────────────────────────
1. Heavy computation on long intraday histories (optimize `max_bars_back`)
2. Requires intraday chart resolution (1m–4h)
3. U.S. session defaults (09:30–16:00 ET); adjust for other exchanges
4. Arrays and tables consume memory – disable extra visuals if unneeded
5. Not for use with Crypto, Forex, or Futures.
6. Only to be used with Stocks/Tickers having volume data.
7. Live trading is coded for a TradersPost.io Webhook and a brokerage account. (IBKR)
────────────────────────────────────────────────────────
WARNINGS
────────────────────────────────────────────────────────
1. This is an Adaptive and Contrarian Trading strategy that scales into DEEP pullbacks,
rides long liquidity waves, and locks profit automatically.
2. Trades can have a long duration but are minimal. This is not a strategy that will
generate thousands of trades. It will save you on commissions to.
3. It does its best to limit losses and but I cannot guarantee it will work for
all assets, all the time. Market conditions vary. Tickers vary.
4. Use it with assets that you trust not to race to zero dollars.
5. Use this strategy with healthy tickers that have medium to high volatility.
6. To eliminate onscreen clutter, uncheck strategy settings/style/trade signals.
7. I use this strategy exclusively. TradingView alerts run for me 24/7 and ROBO trade.
but you should vet the system with manual trades signals it generates for yourself.
8. It does not prevent you from losing profits in after hours trading and Market News.
9. The BIG ASS new bar of opening candle is Not calculated into the stats until it is confirmed. Especially bothersome for me when its a big 10% down candle. You still need to watch the first 9:30 candle with your eyes. I recommend you watch liquidity at Open using a 1m timeframe.
10. This is a pro-grade coded strategy but is NOT a “Wall Street Quant grade.” strategy.
Institutions rely on:
• slippage models
• depth-of-book impact modeling
• latency simulation
• volume-weighted fills
• partial fills & queue priority
• order slicing (TWAP, VWAP, POV)
Pine Script cannot simulate the above.
11. This Pine Script strategy is market-internal (chart & volume) and for personal-use only. The code remains private to me.
12. To the full-time traders — my respect.
I live in the world of code, not charts, scalps, candles and screens,
so I engineered this 2500-line strategy to trade for me with un-emotional discipline, as you do.
If this strategy resonates with you, I provide it for you to use in the TradingView spirit of community. Backtested results are hypothetical and not indicative of future performance.
Nothing here constitutes investment advice.
Trading involves risk, and users must assume full responsibility for their trading decisions.
Remember, its not about making 'all' the money a stock theoretically could return as if you did a buy and hold many years ago - its about making good money as you navigate the waves of the stormy seas, and not sinking. It about making better trade decisions compared to the persons you are trading against. Have fun all the while making your money - work for you.
────────────────────────────────────────────────────────
“Be fearful when others are greedy, and be greedy when others are fearful.”
— Warren E. Buffett
“The stock market is a device for transferring money from the impatient to the patient.”
— Warren E. Buffett
True wealth grows through time, not reaction. A person sits in the shade today because
of a tree that somebody planted years ago.
— Warren E. Buffett
Happy Trading!
สคริปต์ที่ได้รับการป้องกัน
สคริปต์นี้ถูกเผยแพร่เป็นแบบ closed-source อย่างไรก็ตาม คุณสามารถใช้ได้อย่างอิสระและไม่มีข้อจำกัดใดๆ – เรียนรู้เพิ่มเติมได้ที่นี่
— JTM | Flow-Based Trader
Study liquidity. Trust structure. Manage risk.
Study liquidity. Trust structure. Manage risk.
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์ที่ได้รับการป้องกัน
สคริปต์นี้ถูกเผยแพร่เป็นแบบ closed-source อย่างไรก็ตาม คุณสามารถใช้ได้อย่างอิสระและไม่มีข้อจำกัดใดๆ – เรียนรู้เพิ่มเติมได้ที่นี่
— JTM | Flow-Based Trader
Study liquidity. Trust structure. Manage risk.
Study liquidity. Trust structure. Manage risk.
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน