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" )