highlight coming closing timeframe

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #155471 quote
    Jerome888Jerome888
    Participant
    Average

    Hello,

    I have several timeframes open of the same asset. At near the end of a timeframe I would like ot make the windows blinking or something like that so that I see we are approaching the end of a main timeframe.

    The end of a time frame could be assumed for example when 5% of the time remains (so e.g. at 4min45sec for the 5 min timeframe, 14min15sec for the 15 min timeframe etc…)

    How would proceed ? Any existing solution which makes already blinking a window ?

    Thank you

    #156186 quote
    NicolasNicolas
    Keymaster
    Legend

    The below code will make the price chart blink (every time the price is updated) with a red background color.

    defparam drawonlastbaronly=true
    
    PeriodPercent = 30 //5% of the time remains to start blinking the chart 
    // ------
    
    once NbBar = 1
    MyDay=openday
    dayminutes = 1440*(MyDay-MyDay[1])
    MyHour=openhour
    hourminutes = 60*(MyHour-MyHour[1])
    MyMin=openminute
    barminutes = MyMin - MyMin[1] + hourminutes + dayminutes
    barminutes=abs(barminutes)
    imin = lowest[NbBar](barminutes)[1]
    isec = imin*60
    
    itime=opentime
    iremain = (time-itime)
    if islastbarupdate then 
    if iremain>=isec*(1-(periodpercent/100)) then //blink
    if $alpha[0]=0 then 
    $alpha[0]=50
    else
    $alpha[0]=0
    endif
    //backgroundcolor(255,0,0,$alpha[0])
    drawrectangle(0,0,barindex,100000) coloured(255,0,0,$alpha[0]) bordercolor(255,0,0,$alpha[0])
    endif
    endif
    
    return

     

     

    Jerome888 and Nobody thanked this post
    #156315 quote
    Jerome888Jerome888
    Participant
    Average

    Perfect… Thank you very much.

Viewing 3 posts - 1 through 3 (of 3 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

highlight coming closing timeframe


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Jerome888 @jerome888 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Jerome888Jerome888
5 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 12/28/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...