how to get an index of any YYYYMMDDHHMMSS with DateToBarindex similar instructio

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #236992 quote
    oliTRoliTR
    Participant
    Average

    Hello,
    can the DateToBarindex instruction work in a code but not only with a graphical purpose?

    Let’s say, if I define:

          mySessionStartBarIndex=DateToBarindex(YYYYMMDDHHMMSS)

    with YYYYMMDDHHMMSS matching the date and hour of a market opening time, then would this return a corresponding index?

    As it seems not then what would be the solution to get a workeable index ?

    Thanks

    #236997 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Yes, it cannot assign values to variables, only the other way round is possible:

    x = 20240827140000
    drawvline(DateToBarIndex(x)) //fine
    y = DateToBarIndex(x)        //Not supported
    return
    Iván González and oliTR thanked this post
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

how to get an index of any YYYYMMDDHHMMSS with DateToBarindex similar instructio


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
oliTR @olitr Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
2 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/02/2024
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...