Using a variable in the screener ?

Forums ProRealTime English forum ProScreener support Using a variable in the screener ?

Viewing 7 posts - 1 through 7 (of 7 total)
  • #97826

    Hello Folks !

    Is it possible to use a variable in a screener ? let say for example I want to find gappers, my code will be something like:

     

    So when I launch my screener, I may use X as input (X = 1.1 for example for a gap of 10%), is this kind of manoeuvre possible with PRT ?
    Thanks !

    #97829

    Yes.

    Replace last line with:

     

    #97833

    bewoke2– Please always use the ‘Insert PRT Code’ button when posting any code as it makes it far more readable for everyone else. I have tidied up your post for you 🙂

    1 user thanked author for this post.
    #97933

    It didn’t do quite as I want ! I think I wasn’t clear enough.
    Here is how “exactly” my code will like.

    So when I run the scanner, I should be able to input the variable “X” (65, 70, or 80…), it’s like having a global scanner for an RSI above a certain value.
    It is like making a function in C code which takes an input from the user before displaying the result.

    But now, I get “X” is not defined (which is true)

    Thanks!

    #97951

    It is not possible to have externally adjustable variables in a screener. You will need to manually modify the screener to change the value or set up multiple screeners one for each chosen value.

    1 user thanked author for this post.
    #97952

    First, replace the last line with:

    Then you will have to hard code X inside the code; screeners and strategies do not allow users to change data (only indicators can).

     

     

    1 user thanked author for this post.
    #97959

    Thanks ! resolved.

Viewing 7 posts - 1 through 7 (of 7 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login