How to code proximity of SMA10 & SMA5

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #150337 quote
    telboy
    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_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
    telboy
    Participant
    Junior

    thank you noobywan

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

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 telboy
5 years, 3 months ago.

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