Fix and Enhance Pine Script

Job ID: 39648911

Budget: $10 – $30 USD

Project Title:
TradingView Pine Script – 90-Minute Cycle Boxes with Macro Time Highlights
________________________________________
Objective:
Develop a TradingView Pine Script (v5) that:
1. Draws outlined 90-minute session boxes (no fill by default)
2. Adds macro time markers at the bottom of the chart
3. Works across all intraday timeframes, but displays by default only on 1H and below
________________________________________
90-Minute Cycle Box Logic:
Draw outlined rectangles for each of the following 90-minute cycles, repeating daily:
Cycle # Start Time End Time
1 09:30 AM 11:00 AM
2 11:00 AM 12:30 PM
3 12:30 PM 02:00 PM
4 02:00 PM 03:30 PM
5 03:30 PM 05:00 PM
6 05:00 PM 06:30 PM
7 06:30 PM 08:00 PM
8 08:00 PM 09:30 PM
9 09:30 PM 11:00 PM
Box Drawing Requirements:
• Use box.new() to draw each box
• Draw once at the start of each cycle
• Show past and current boxes — don’t limit to current session
• Stretch vertically across the chart or use high/low of the interval
• Default style: outline only, no fill
o border_color: visible
o bgcolor: na or color.new(_, 100)
________________________________________
Macro Time Highlighting:
Draw bold visual markers at the bottom of the chart for each of these macro time windows:
makefile
CopyEdit
09:45 AM – 10:15 AM
10:45 AM – 11:15 AM
11:45 AM – 12:15 PM
12:45 PM – 01:15 PM
01:45 PM – 02:15 PM
02:45 PM – 03:15 PM
03:45 PM – 04:15 PM
04:45 PM – 05:15 PM
05:45 PM – 06:15 PM
06:45 PM – 07:15 PM
07:45 PM – 08:15 PM
08:45 PM – 09:15 PM
09:45 PM – 10:15 PM
10:45 PM – 11:15 PM
Marker Requirements:
• Use a bold horizontal box.new() or line.new() near the bottom of the price scale
• Appear at every listed interval
• Must support multiple days (not just live candles)
• Bold color and opacity (can be editable via input)
• Automatically sync with chart’s timezone (syminfo.timezone)
________________________________________
Time Handling:
• Use hour(time) and minute(time) with the chart’s native timezone
• Do not hardcode UTC offsets
________________________________________
Timeframe Control:
• Script should automatically display on 1-minute to 1-hour timeframes
• Use:
pinescript
CopyEdit
timeframe.isintraday and timeframe.multiplier <= 60
________________________________________
Inputs (User Settings):
• Toggle:
o Show 90-min cycle boxes
o Show macro time markers
• Color pickers:
o Border color (cycle boxes)
o Fill color (optional, off by default)
o Macro line color
• Optional toggles for:
o Macro time label text
o Show only current day’s cycles
________________________________________
Implementation Tools:
• box.new() for both 90-min blocks and macro markers
• line.new() (if preferred for macro lines)
• Use var to prevent redraw loops
• Apply efficient checks to reduce computation on low timeframes
________________________________________
Deliverables:
• Fully working Pine Script v5
• Clean comments and structure
• Default visibility on ≤1H
• Optimized for performance
• Optional chart link/screenshot
Related categories: Debugging Pine Script