Higer exponential average

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

    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
    robertogozzi
    Moderator
    Master

    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
    Ludde
    Participant
    New

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

    #234860 quote
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
1 year, 8 months ago.

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