I am hiring an experienced NinjaTrader 8.1.6.3 / NinjaScript developer to build an Indicator that reads user-drawn, locked rectangles and exports breakout metrics to CSV.
This tool is strictly a measurement/export utility. It does NOT detect rectangles automatically.
Chart Environment
• Instrument: ES (front month contracts)
• Timeframe: 3-minute bars only
• Single data series only
• User manually draws and locks rectangles
• Rectangles will NOT overlap
• If overlap would occur, will not draw the second rectangle
Rectangle Definition
Each rectangle (“RECT”) represents a user-defined price structure.
The indicator must:
• Enumerate all user-drawn rectangle objects on the chart
• Read each rectangle’s price anchors:
o RectHigh
o RectLow
• Read rectangle start time anchor
Breakout (Exit) Definition
For each RECT:
Scan forward starting from rectangle start time.
Exit occurs at the first 3-minute bar CLOSE outside the rectangle:
• UP Exit: Close > RectHigh
• DOWN Exit: Close < RectLow
Exit bar close price = Entry proxy.
Exit bar time = timestamp of that bar.
If no close outside occurs, no row is exported for that rectangle.
ATR
• ATR(5)
• Computed on the same 3-minute series
• Value recorded at the exit bar close
Target Definition
TargetPoints = 10.00
For UP exit:
Target reached if High >= ExitClose + 10.00
For DOWN exit:
Target reached if Low <= ExitClose − 10.00
Record:
• Price when target first reached
• Time when target first reached
• BarsToTarget (exit bar = 0 convention)
Invalidation Definition
Invalidation occurs when:
Two consecutive 3-minute closes occur back inside the same rectangle.
Inside means:
RectLow <= Close <= RectHigh
Invalidation time = time of second inside close.
Invalidation price = close of second inside close.
If invalidation never occurs before session end:
• Invalidation fields remain blank.
• Tracking windows extend to session end.
Extreme Tracking Rules
- Highest/Lowest after exit (stop at invalidation or session end)
• Highest high from exit forward until invalidation (or session end)
• Lowest low from exit forward until invalidation (or session end) - Extreme before decision (+10 or invalidation)
Decision time = earlier of:
• Target hit
• Invalidation
Track favorable-direction extreme from exit until decision time.
CSV Export Columns (Exact Order)
CSV Output Column Specification
(One row per Rectangle breakout event)
- DATE
Format: YYYYMMDD
Example: 20260225
- FUTURES CONTRACT
Example: ES MAR26
- RECT
Integer (1, 2, 3, etc.)
Rectangle sequence number for that date.
- RECT TAG / RECT ID
User-defined identifier (string).
Optional field if present on rectangle tag.
- RECT HI
Top price of rectangle (double).
- RECT LO
Bottom price of rectangle (double).
- RECT EXIT DIRECTION (U/D)
“U” = Breakout above RECT HI
“D” = Breakout below RECT LO
Exit defined as first bar CLOSE outside rectangle.
- EXIT BAR CLOSE PRICE
Close of first bar that closes outside rectangle.
- TIME OF EXIT BAR CLOSE
Time (HHmm or platform time format).
- ATR @ EXIT BAR CLOSE
ATR(5) on 3-minute bars at close of exit bar.
- TARGET PRICE
Calculated level:
If U:
ExitBarClose + 10.00
If D:
ExitBarClose - 10.00
Always populated.
- HIGHEST PRICE AFTER EXIT (STOP AT INVALIDATION)
For U direction:
Highest HIGH reached after exit until earlier of:
• Target hit
• Invalidation (2 consecutive closes back inside rectangle)
For D direction:
Leave blank.
- LOWEST PRICE AFTER EXIT (STOP AT INVALIDATION)
For D direction:
Lowest LOW reached after exit until earlier of:
• Target hit
• Invalidation
For U direction:
Leave blank.
- BAR EXTREME PRICE WHEN +10 REACHED (B4 INVAL)
If target reached before invalidation:
For U:
High of first bar where
High >= TargetPrice
For D:
Low of first bar where
Low <= TargetPrice
Blank if target never reached.
- TIME WHEN +10 REACHED (B4 INVAL)
Time of that first target-hit bar.
Blank if never reached.
- PRICE LO/HI B4 +10 REACHED OR INVAL OCCURS
Favorable extreme before the earlier of:
• Target hit
• Invalidation
For U:
Highest HIGH from exit until earlier of those events.
For D:
Lowest LOW from exit until earlier of those events.
- CLOSING PRICE OF 2ND CONSEC BAR BACK INSIDE RECT
Invalidation definition:
Two consecutive closes back inside rectangle.
This column records the CLOSE of the second consecutive bar.
Blank if invalidation never occurs.
Notes for Developer
• Only one breakout per rectangle.
• No overlapping rectangles.
• Data collection window: 8:30 CT – 3:00 PM CT.
• 3-minute bars only.
• Invalidation requires two consecutive closes inside rectangle.
• Processing stops once target or invalidation occurs (except where explicitly stated for post-event tracking).
Indicator Requirements
• Indicator (not strategy)
• Property: ExportNow (bool toggle)
• Property: ExportFolder (path)
• Property: ContractLabel (optional string)
• Property: Debug (bool)
Export must:
• Create uniquely named CSV
• Not overwrite previous exports unless specified
Milestones
Milestone 1:
Read rectangles and export basic anchor data.
Milestone 2:
Add exit detection + ATR export.
Milestone 3:
Add target, invalidation, and extreme tracking.
Milestone 4 (optional polish):
Stable ordering, error handling, short user guide.