Higer exponential average

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #234797 quote
    LuddeLudde
    Participant
    Junior

    Hi; I wonder if You can help me with this.

    I would like to have a proscreener with the following conditions:

    1. An 8-day exponential moving average (EMA) that is turning upwards.
    2. The 8-day EMA must also be higher than the last time the 8-day EMA turned upwards.

     

    #234802 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    ONCE CurrTurn = 0
    ONCE PrevTurn = 0
    Cond = 0
    Sma8 = average[8](close)
    UPturn = (Sma8 > Sma8[1]) AND (Sma8[1] < Sma8[2])
    IF UPturn THEN
       PrevTurn = CurrTurn
       CurrTurn = Sma8
       IF CurrTurn > PrevTurn THEN
          Cond = 1
       ENDIF
    ENDIF
    SCREENER[Cond]
    Iván González thanked this post
    #234840 quote
    LuddeLudde
    Participant
    Junior

    Thank you for helping me, but it doesn´t work for me. I gets all kind of different hits.

    #234860 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    My bad, I incorrectly coded SMA instead of EMA.

    This is correct:

    ONCE CurrTurn = 0
    ONCE PrevTurn = 0
    Cond = 0
    Ema8 = average[8,1](close)
    UPturn = (Ema8 > Ema8[1]) AND (Ema8[1] < Ema8[2])
    IF UPturn THEN
       PrevTurn = CurrTurn
       CurrTurn = Ema8
       IF CurrTurn > PrevTurn THEN
          Cond = 1
       ENDIF
    ENDIF
    SCREENER[Cond]
    Ludde 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

Higer exponential average


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Ludde @ludde Participant
Summary

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

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