How to create specific date in probuilder

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #158327 quote
    cc267
    Participant
    Average

    Trying to do a screener for a specific date but unsure how to define the variable date in the probuilder section.

    I have put

    myDate = 202002202

    RETURN Date

    Not sure this is displaying it correctly, can anyone help?

    #158337 quote
    cc267
    Participant
    Average

    I have now changed it to this – does this look correct?

    myDate = YYYYMMDD
    YYYYMMDD = Date
    RETURN Date

    #158347 quote
    robertogozzi
    Moderator
    Master

    No, your code is wrong.

    YYYYMMDD is the correct date format.

    You can build any date by multiplying single data this way:

    YYYY0000      2020 * 10000   = 20200000 +
    MM00                  2 *     100    =            200 +
    DD                        2 *         1     =                2 =
    YYYYMMDD                             = 20200202

    DATEs are just numbers.

    #158359 quote
    cc267
    Participant
    Average

    YYYYMMDD = Date
    RETURN Date

    This is what I have in probuilder to return date – then in screener i will input specific date but it is not working?

    #158373 quote
    Monobrow
    Participant
    Senior

    I have taken this example from another thread. code is by Nicholas. take some time to understand it, feel free to ask questions

     

    ONCE Periods = 20             //last 20 bars
    ONCE PerCent = Periods * 0.9  //90% of times on the rise
    ONCE RsiNum  = 14
    MyRsi = rsi[RsiNum](close)
     
    idate = 20190106
     
    if summation[Periods](MyRsi > MyRsi[1]) >= PerCent and date=idate then 
    test=1
    endif
     
     
    SCREENER[test]

    setting the idate to your selected date and using date=idate is the key for you I think.

    #158415 quote
    cc267
    Participant
    Average

    Thanks alot, think I have it now! is the main chart meant to reflect the date i set? as the main chart isn’t switching to the date I have set? instead i am having to manually go to that date.

    #158416 quote
    Monobrow
    Participant
    Senior

    instead i am having to manually go to that date.

    Yeah, unfortunately they are separate entities, but you can have many many charts, so set it up as you wish 👍

    #158654 quote
    Vonasi
    Moderator
    Master

    cc267 – Follow the forum rules.

    • Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

How to create specific date in probuilder


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
cc267 @cc267 Participant
Summary

This topic contains 7 replies,
has 4 voices, and was last updated by Vonasi
5 years ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/18/2021
Status: Active
Attachments: No files
Logo Logo
Loading...