EMA 45 degres Uptrend

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #70237 quote
    InertiaInertia
    Participant
    Master

    Hi dream team !

    How can we code this “EMA (x°) uptrend” please ?

    Thank you 😉

    #70242 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    No, we CAN’T!

    As you can see from the attached pic made with the help of eXcel, all of the 3 examples are uptrending, but their grade is different.

    You can only tell uptrends as Higher Highs & Higher Lows and downtrends as Lower Highs & Lower Lows!

    You may detect a downtrending EMA  comparing its value, say, now and 10 bars ago and 20 bars ago…. if it’s always decreasing you may assume there is a downtrend ongoing (in that TF), but you cannot grade it.

    x-2.jpg x-2.jpg x2.jpg x2.jpg
    #70254 quote
    InertiaInertia
    Participant
    Master

    Grazié à Lei Roberto for your complete answer.

    Appreciated.

    #70279 quote
    VonasiVonasi
    Moderator
    Master

    Similar I think to what Robertogozzi said you can apply a gradient score to the average by subtracting the average level x bars ago from the average level now and dividing by x. By comparing different values of x you can confirm whether the steepness of gradient is increasing or decreasing.

    Could you not then also return this as degrees by the following formula?

    Period = 200 //Average period
    x = 1 //Number of bars to look back
    
    Gradient = (ExponentialAverage[Period](close) - ExponentialAverage[Period](close[x]))/x
    
    Angle = ATAN(Gradient)
    
    Return 0, Angle
    
    #70280 quote
    VonasiVonasi
    Moderator
    Master

    Sorry – please ignore the code in the last post as I just realised that one side of the gradient calculation is an unknown distance in pips so the calculation will not return a true angle. Back to school for me I think!

    Inertia thanked this post
    #70281 quote
    robertogozzirobertogozzi
    Moderator
    Legend
Viewing 6 posts - 1 through 6 (of 6 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 45 degres Uptrend


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Inertia @inertia Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by robertogozzirobertogozzi
8 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/12/2018
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...