Entropy indicator conversion code mq5 to prorealtime

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #70706 quote
    abd78
    Participant
    Veteran

    The entropy is the measure of the disorder of the system. The entropy is calculated using the Maximum Entropy Method.

    If we try to evaluate it according to its indicative attributes without paying much attention to its code, we will find out that it is an ordinary unnormalized oscillator and it is possible to apply to it all appropriate technical analysis methods. The indicator was presented in two variants – as a line (Entropy.mq5) and as a multicolored histogram (ColorEntropy.mq5).

    https://www.mql5.com/en/code/397
    thank you

    #70718 quote
    Nicolas
    Keymaster
    Master

    This Entropy indicator is converted, here is the code:

    numbars=14
    
    sumx = 0 
    sumx2=0
    avgx =0
    rmsx = 0.0
    
    for j=0 to numbars do
    
    r=Log(Close[j]/Close[j+1])
    
    sumx=sumx+r
    sumx2=sumx2+(r*r)
    
    next
    
    if(numbars=0) then 
    avgx=Close
    rmsx=0.0
    else  
    avgx=sumx/numbars
    rmsx=Sqrt(sumx2/numbars)
    endif
    
    P = ((avgx/rmsx)+1)/2.0
    
    G = P * Log(1+rmsx) + (1-P) * Log(1-rmsx)
    
    
    return G style(line,2),0 coloured(100,100,100) style(dottedline,1),0.00001 coloured(100,100,100) style(dottedline,1),-0.00001 coloured(100,100,100) style(dottedline,1)
    abd78 thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Entropy indicator conversion code mq5 to prorealtime


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
abd78 @fede9483 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
7 years, 8 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/17/2018
Status: Active
Attachments: 4 files
Logo Logo
Loading...