How to code proximity of SMA10 & SMA5

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #150337 quote
    telboytelboy
    Participant
    Junior

    Hi

     

    whats the easiest way to code the below condition please:

    “SMA 5 day within 2% of the SMA 10 day within last 2 days”

    Many thanks

    #152516 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    Condition for sma5 and sma10 within 2% in last 2 days:

    sma5=Average[5](close)
    sma10=Average[10](close)
    within=(abs(sma5-sma10)/sma10<=0.02)
    within2= within or within[1]
    
    return within2
    #152706 quote
    telboytelboy
    Participant
    Junior

    thank you noobywan

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

How to code proximity of SMA10 & SMA5


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
telboy @telboy Participant
Summary

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

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