Ema in correct sequence

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

    hello. I needed help with a code in ema so that it will buy when ema 5.8.13.21 is in sequence just as I show in the picture. I have written examples 5>8 and 13>21 but I don’t really think it makes the right inputs on the script. Can I write something else?

    Screenshot_2023-11-24-16-06-49-71_99c04817c0de5652397fc8b56c3b3817.jpg Screenshot_2023-11-24-16-06-49-71_99c04817c0de5652397fc8b56c3b3817.jpg
    #224260 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    This is an indicator, just remove the last 5 lines and use UPtrend and DNtrend to tell the position of EMAs:

     

    src     = CustomClose
    Ema5    = average[5,1](src)
    Ema8    = average[8,1](src)
    Ema13   = average[13,1](src)
    Ema21   = average[21,1](src)
    UPtrend = (Ema5 > Ema8) AND (Ema8 > Ema13) AND (Ema13 > Ema21)
    DNtrend = (Ema5 < Ema8) AND (Ema8 < Ema13) AND (Ema13 < Ema21)
    x = UPtrend
    IF x = 0 THEN
       x = -DNtrend
    ENDIF
    RETURN x coloured by (x) Style(Histogram,1) AS "Trend, 1=UP, 2=DOWN"
    kvacksa87 thanked this post
    #224262 quote
    kvacksa87kvacksa87
    Participant
    Junior

    Thanks for quick reply it is appreciated

    robertogozzi thanked this post
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

Ema in correct sequence


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
kvacksa87 @kvacksa87 Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/24/2023
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...