Recognize daily timeframe inside the code

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #61961 quote
    AsedubelinAsedubelin
    Participant
    Junior

    Dear Sir,

    is it possible inside the code to have a function that understands if the indicator is based on a daily chart or a 1-hour chart ?

    #61967 quote
    NicolasNicolas
    Keymaster
    Legend

    Yes, this code snippet will return the minutes quantity of the current timeframe:

    once NbBar = 1
    
    //if BarIndex < NbBar+2 then
    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)
    Mybarminutes = lowest[NbBar](barminutes)[1]
    //endif
    
    return Mybarminutes as "Timeframe"

    I don’t remember who post this snippet initially, but thanks to him.

    #61969 quote
    AsedubelinAsedubelin
    Participant
    Junior

    Thanks

    #62126 quote
    LeoLeo
    Participant
    Veteran

    It was you Nicolas šŸ˜‰

    here

    INTRADAY DILATATION FACTOR

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

Recognize daily timeframe inside the code


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Asedubelin @asedubelin Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by LeoLeo
8 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/08/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...