code a moving average applied to any other indicator?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #86485 quote
    Bel
    Participant
    New

    Good morning fam.

    I’m able to code simple stuff that shows buy/sell conditions on chart using simple call function but would like to know how to code moving average which is applied to another indicator. Can anyone suggest what the code should look like?

    Still early morning here so pardon if my question doesn’t make much sense:)

     

    Best regards.

    #86488 quote
    Nicolas
    Keymaster
    Master

    You can “inject” any data serie in another indicator.

    In the below example, the variable “test” is containing RSI data serie, this variable is then pass through a simple moving average:

    test = rsi[14]
    
    result = average[7](test)
    
    return result
    Bel thanked this post
    #86505 quote
    Bel
    Participant
    New

    Ok thanks Nicolas got it working. I want to add now IF RSI[14] is lower then Average[7] (for example) then DRAWARROWUP(barindex,low)coloured(212,66,244) if not then vice-versa, but can’t find the correct way to do it. One more help would be appreciated. Still a green boy in coding land but learning quickly!

    #86509 quote
    Bel
    Participant
    New

    Looks like i got it! Thanks once again Nicolas 🙂

    #86774 quote
    Bel
    Participant
    New

    Hello friends. I’m trying to code a simple indi to do this:

    • If the day closes up, movement = 1, otherwise movement = -1.
    • Sum movement over the last 20 days.
    • UDIDSRI is the % rank of today’s sum, compared to the last 50 days of sums.

    Not sure how to make the comparison,  any help would be appreciated. Thank you.

    A=close>open
    B=close<open
    C=summation[20](A+B)
    D=summation[50](A+B)
    
    #86785 quote
    Vonasi
    Moderator
    Master

    Hello friends. I’m trying to code a simple indi to do this

    Then please start a new topic for a new question/request.

    #87052 quote
    Bel
    Participant
    New

    Didn’t want to clutter but will do next time. Cheers.

    #87053 quote
    Vonasi
    Moderator
    Master

    Didn’t want to clutter

    New topics are not clutter but just help to keep every thing relevant and easy to search for by other forum users in the future. Going off topic in a thread means that no one will ever be able to find the useful information that might be in the new discussion.

    It is better to have 100 different topics cluttering up the place than one topic with 100 different discussions hidden in it!

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

code a moving average applied to any other indicator?


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Bel @saulyte1 Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 12/07/2018
Status: Active
Attachments: No files
Logo Logo
Loading...