MA change direction

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

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

    #118623 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    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.
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

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 robertogozzirobertogozzi
6 years, 8 months ago.

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