Skip to content

www8351/HTF_Mirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

HTF Mirror

Pine Script v6 ยท TradingView indicator + Python microservice

HTF Mirror projects the developing higher-timeframe (HTF) candle โ€” default 4H โ€” into the right margin of any chart: solid body, dotted range footprint, open level, equilibrium, and a High / Low / Last + countdown label.

Disclaimer: HTF Mirror is an analytical tool, not financial advice. Trading involves substantial risk of loss. Past performance does not guarantee future results. You are solely responsible for your decisions.


Two components

Component What it is Where it lives
HTF Mirror.pine TradingView indicator (Pine Script v6). Draws the chart projection. HTF Mirror.pine
service/ Stateless Python microservice. Exposes the same projection math over HTTP so external engines (MT5, Python bots, backtesters) can consume it. service/

TradingView indicator

What it draws

Element Description
Projected candle Solid body + wick of the developing HTF candle, drawn in the right margin.
Dotted range footprint High/low box of the live HTF candle from period start.
Open level Dotted line at the HTF open.
Equilibrium Dotted line at 50% of the range (high + low) / 2.
Side label High / Low / Last price and countdown to HTF close.

Inputs

Group Key inputs
HTF HTF timeframe (default 240 = 4H), manual label prefix.
Projection Right-margin offset, body width, toggles for range / wick / open / EQ.
Style Monochrome or PO3 gradient (bull / bear / weak), transparency.
Label Size, countdown toggle.

Install

  1. Open TradingView โ†’ Pine Editor.
  2. Paste the contents of HTF Mirror.pine.
  3. Add to chart.

The projection uses non-repainting request.security with lookahead_off. The developing candle updates live (intrabar).


Microservice

Pine runs only inside TradingView โ€” it cannot be containerized or called by an external engine. The service/ directory ports the indicator's deterministic math to a stateless FastAPI service so any trading engine can obtain the same projection over HTTP.

Quick start

cd service
docker build -t htf-mirror-service .
docker run --rm -p 8000:8000 htf-mirror-service
curl -s http://localhost:8000/v1/projection \
  -H 'Content-Type: application/json' \
  -d '{"bars":[{"open":10,"high":12,"low":9,"close":11},
               {"open":11,"high":20,"low":8,"close":18}]}'
{
  "open": 10.0, "high": 20.0, "low": 8.0, "last": 18.0,
  "equilibrium": 14.0, "range": 12.0, "strength": "bull", "countdown": "--:--:--"
}

Full API docs, MT5 integration guide, and architecture diagram: service/README.md


License

Commercial build. TradingView access control (Invite-Only / Whop) is enforced via TradingView publish settings. The microservice compute core ships for use in your own engines.

About

๐Ÿ“Š HTF Mirror: TradingView Pine Script v6 indicator + Python FastAPI microservice for real-time Higher-Timeframe candle projection and external engine consumption.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors