Simple Price Crosses Moving Average Screen

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #53128 quote
    mrfixituk41
    Participant
    New

    All I need is a simple code to screen for when the price crosses the 200 day moving average – either bullish or bearish. I haven’t a clue.

    #53131 quote
    robertogozzi
    Moderator
    Master

    Try this one:

    x = 0
    Avg200 = Average[200](close)
    IF (close CROSSES OVER Avg200) OR (close CROSSES UNDER Avg200) THEN
       x = 1
    ENDIF
    SCREENER [x] (x AS "criterium")

    Roberto

    #53147 quote
    mrfixituk41
    Participant
    New

    Thanks Roberto.  I added a volume screen to it. Not sure it’s the right one but it’s a start. Looking for breakouts bullish or bearish from just above the 100 day moving average or 200 day. Preferably when these moving averages are “flat” against the price on the charts.

    x = 0
    Avg100 = Average[100](close)
    IF (close CROSSES OVER Avg100) OR (close CROSSES UNDER Avg100) THEN
    x = 1
    ENDIF
    SCREENER [x] (x AS “criterium”)
    v = volume

    count = 0
    for i = 1 to 75 do
    if v>volume[i] then
    count=count+1
    endif
    next

    condition = count/75>0.9

    screener [condition] (count/75 as “percentage”)

     

    #53285 quote
    robertogozzi
    Moderator
    Master

    You cannot use the keyword SCREENEDR more than once, so you have to combune your condition to make only one screener and, unfortunately, you can only use one sortinfg criterium:

    x = 0
    Avg100 = Average[100](close)
    IF (close CROSSES OVER Avg100) OR (close CROSSES UNDER Avg100) THEN
       x = 1
    ENDIF
    v = volume
    count = 0
    for i = 1 to 75 do
       if v>volume[i] then
          count=count+1
       endif
    next
    condition = count/75>0.9
    //SCREENER [x] (x AS “criterium”)
    screener [x AND condition] (count/75 as “percentage”)  //you may use OR, instead but only x OR condition as criterium
    Nicolas thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Simple Price Crosses Moving Average Screen


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

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

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 11/17/2017
Status: Active
Attachments: No files
Logo Logo
Loading...