How to format Date[N] in screener results

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #170324 quote
    HansLatourHansLatour
    Participant
    New

    How can I format the Date[N] variable in a column of the screener.
    It ‘translates’ YYYYMMDD’ to a numeric value.

    #170340 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    IT IS a numeric value. ProRealTime only supports floating point numeric data,

    A date is usually displayed, with DrawText, as 20M (20 million).

    You can try to remove the two leftmost digits (20), with this trick, so that 20210526 is abridged to 210526, but it will be reported with the thousands separator and, for years 0 to 9 the leading 0’s will be dropped (not tested):

    x      = round((date / 1000000) - 0.5)
    y      = x * 1000000
    MyDate = date - y
    #170361 quote
    HansLatourHansLatour
    Participant
    New

    Hi Roberto, thanks for your solution, works great!

    I created a millennium-bug by taking a shortcut to your code by just subtracting 20000000 🙂

    robertogozzi thanked this post
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

How to format Date[N] in screener results


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
HansLatour @hanslatour Participant
Summary

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

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 05/25/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...