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
    oliTR
    Participant
    New

    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
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
1 year, 5 months ago.

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