Screener Output Argument

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #10451 quote
    Juzz MeJuzz Me
    Participant
    New

    It would be great if one of the more experienced coders out there lent me a helping hand.

    I have finally managed to put together a screener all by myself. The only thing that I cannot figure out is how to customize the output. Say this is my last line:

    SCREENER [((c1 AND c2 AND c3 AND c4 AND c5) or (c6 AND c7 AND c8 AND c9 AND c10)) and c11 and c12] (Variation AS "%Chg prev bar")

    I want the screener to display in the output/screener list a column with the word

    – “long” when the first argument is valid, i. e. “c1 AND c2 AND c3… and c12”
    – “short” when the second argument is valid, i. e. “c6 AND c7 AND c8…and c12”

    Could anyone tell me how I need to modify this?

    Thanks so much!

    #10453 quote
    NicolasNicolas
    Keymaster
    Legend

    The best you can do is to setup a variable with your long or short conditions, like this:

    //long conditions test
    if c1 and c2 and c3 then 
      sort = 1
    endif
    
    //short conditions test 
    if c4 and c5 and c6 then 
     sort = -1
    endif

    It’s not possible to make string variable, so the result of sort would “1” for long and “-1” for short.

    Now for your screener display, you should write it like this :

    SCREENER [(c1 and c2 and c3) or (c4 and c5 and c6)] (sort as "trade direction")

    Of course this is an example and you should adapt it to your screener already coded conditions. Please let us know if it’s ok for you.

    #10455 quote
    Juzz MeJuzz Me
    Participant
    New

    Nicolas,

    Thank you so much for the quick reply! Where would I add the variable – if I put it in the code before the Screener output, the “sort” apparently creates an error message.

    //long conditions test
    if c1 AND c2 AND c3 AND c4 AND c5 and c11 and c12 then 
      sort = 1
    endif
    
    //short conditions test 
    if c6 AND c7 AND c8 AND c9 AND c10 and c11 and c12 
     sort = -1
    endif
    
    SCREENER [((c1 AND c2 AND c3 AND c4 AND c5) or (c6 AND c7 AND c8 AND c9 AND c10)) and c11 and c12] (sort as "trade direction")
    
    
    #10458 quote
    NicolasNicolas
    Keymaster
    Legend

    and what is the error message you have?

Viewing 4 posts - 1 through 4 (of 4 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

Screener Output Argument


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Juzz Me @juzz_me Participant
Summary

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

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 07/13/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...