MA change direction

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #118620 quote
    mixzzz
    Participant
    New

    Looking for creating alert when moving average changes its direction (colour)

    #118623 quote
    robertogozzi
    Moderator
    Master

    There you go, set an alert whenever 1 or -1 is returned:

    MyMA = average[20,0](close)                      //Sma20
    Result = 0
    IF MyMA > MyMA[1] AND MyMA[1] < MyMA[2] THEN     //Going North
       Result = 1
    ELSIF MyMA < MyMA[1] AND MyMA[1] > MyMA[2] THEN  //Going South
       Result = -1
    ENDIF
    RETURN Result
    Nicolas thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

MA change direction


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
mixzzz @mixzzz Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
6 years ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/04/2020
Status: Active
Attachments: No files
Logo Logo
Loading...