pro // sessions

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #247199 quote
    Patrick K TemplarPatrick K Templar
    Participant
    Average

    Could you help me with this code please coding I’m trying to make a like a boxing so I can see what sessions are in play and within the UK is at the bottom my coding is not that     could add the ny and tokyo as well pleses  gmt

    // --- PARAMETERS ---
    sessionStartHour = 8     // Change to match session start time (e.g. London Open)
    sessionEndHour = 16      // Change to match session end time (e.g. London Close)
    
    // VWAP + Price Aggregation
    cumVol = 0
    cumVolPrice = 0
    
    // Session High/Low/Mean
    sessionHigh = -1e10
    sessionLow = 1e10
    sessionOpen = open
    
    // Detect New Session (reset at session start)
    if time = sessionStartHour * 10000 then
    cumVol = 0
    cumVolPrice = 0
    sessionHigh = high
    sessionLow = low
    sessionOpen = open
    endif
    
    // Update during session
    if time >= sessionStartHour * 10000 and time <= sessionEndHour * 10000 then
    cumVol = cumVol + volume
    cumVolPrice = cumVolPrice + close * volume
    sessionHigh = max(sessionHigh, high)
    sessionLow = min(sessionLow, low)
    endif
    
    // Calculated values
    vwap = cumVolPrice / cumVol
    sessionMean = (sessionHigh + sessionLow + sessionOpen) / 3
    
    // --- DISPLAY ---
    draw vwap as "VWAP" coloured(0, 128, 255)
    draw sessionMean as "Mean" coloured(255, 165, 0)
    draw sessionHigh as "High" coloured(0, 255, 0)
    draw sessionLow as "Low" coloured(255, 0, 0)
    #247242 quote
    larouedegannlarouedegann
    Participant
    Master
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

pro // sessions


ProBuilder: Indicators & Custom Tools

New Reply
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by larouedegannlarouedegann
1 year, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/16/2025
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...