How to call a custom indicator in the past with proscreener

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #56493 quote
    OlivierLarueOlivierLarue
    Participant
    Average

    Hi,

    I’m trying to call a custom indicator function from a proscreener scan.

    What I’m trying to do is to request a custom bar index in the past : for example the indicator result from 30 days ago (as it appears on the charts)…

    I found the CustomClose parameter but it doesn’t seem to be working…

    Is that even possible ?

    So far I came up with this :

    // Here I'm trying to get the result for my indicator "myCustomFunction" : 
    // Today
    // 10 days ago
    // 20 days ago
    // What the indicator does is not important in this example...
    // Let's say it returns either 1 or 0, and here I'm trying to find stocks in which the indicator value was 1 on bars 0, 10, 20
    
    score0 = CALL "myCustomFunction"(CustomClose[0])
    score1 = CALL "myCustomFunction"(CustomClose[10])
    score2 = CALL "myCustomFunction"(CustomClose[20])
    
    score = score0 + score1 + score2
    
    SCREENER[score = 3](score as "score")
    #56494 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    I did not test it, but you can try

    // Here I'm trying to get the result for my indicator : 
    // Today
    // 10 days ago
    // 20 days ago
    // The indicator doesn't matter in this example.
    // Let's say it returns either 1 or 0, and here I'm trying to find stocks in which the indicator value was 1 on bars 0, 10, 20
     
    MyScore = CALL "myCustomFunction"(CustomClose)
     
    score = MyScore  + MyScore[10] + MyScore[20]
     
    SCREENER[score](score as "score")

    Roberto

    OlivierLarue thanked this post
    #56496 quote
    OlivierLarueOlivierLarue
    Participant
    Average

    Thank you SO MUCH Roberto, it works!…
    I really struggled on it..
    Have a nice Christmas.
    Olivier

    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 call a custom indicator in the past with proscreener


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
OlivierLarue @olivier7 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by OlivierLarueOlivierLarue
8 years, 9 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 12/24/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...