Question about screener optimization

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #204627 quote
    ZeroCafeineZeroCafeine
    Participant
    Senior

    Hi everyone

    I have a small question about screener optimization, I want to use this code, so I need only the last 20 bar, so I use the IF condition with BarIndex > 1000 (because on the screener I saw he use the last 1024 bar)

    the question is : about the variable (MM10 & MM20) I have to declare them inside the condition or outside? Does it change anything about the optimization?

    MM10 = Average[10](Close)
    MM20 = Average[20](Close)
    
    C1 = MM10 Crosses Over MM20
    
    IF BarIndex > 1000 Then
    For x = 0 To 5 Do
    IF C1[x] Then
    test = 1
    Y = x
    Break
    ELSE
    test = 0
    ENDIF
    Next
    ENDIF
    
    SCREENER[test](Y AS "N")

     

    Best Reguards

    #204682 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    I tried this indicator and it seems to be working fine as is, without moving the two SMAs inside IF..ENDIF:

    MM10 = Average[10](Close)
    MM20 = Average[20](Close)
    
    C1 = MM10 Crosses Over MM20
    y = 0
    IF BarIndex > 1000 Then
       For x = 0 To 5 Do
          IF C1[x] Then
             test = 1
             Y = x
             Break
          ELSE
             test = 0
          ENDIF
       Next
    ENDIF
    RETURN Y//Test
    ZeroCafeine thanked this post
    #204959 quote
    ZeroCafeineZeroCafeine
    Participant
    Senior

    tks you @robertogozzi, so it doesn’t matter where I declare them

    #204966 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Right, provided these lines are always in this same order:

    MM10 = Average[10](Close)
    MM20 = Average[20](Close)
    C1 = MM10 Crosses Over MM20
    ZeroCafeine thanked this post
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

Question about screener optimization


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

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

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 11/22/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...