Hurst indicator MT4 conversione

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #20803 quote
    tatankayotanka
    Participant
    Senior

    E possibile convertire in linguaggio per prorealtime  il seguente script?

    #property  indicator_chart_window
    
    #property  indicator_buffers 1
    
    #property  indicator_color1  White
    
    
    extern int year=2010;
    
    extern int month=6;
    
    extern int day=1;
    
    extern int hour=0;
    
    extern int minute=0;
    
    extern double inf=18000;
    
    extern double sup=21000;
    
    extern double cyclelength=60;
    
    extern double trend=0;
    
    extern int Ncicli=2;
    
    //---- buffers
    
    double Hurst[];
    
    
    //+------------------------------------------------------------------+
    
    //| Custom indicator initialization function                         |
    
    //+------------------------------------------------------------------+
    
    int init()
    
    {
    
    //---- indicators
    
    IndicatorBuffers(1);
    
    
    SetIndexBuffer(0,Hurst);
    
    
    SetIndexStyle(0,DRAW_LINE,0,1);
    
    
    IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
    
    IndicatorShortName(WindowExpertName());
    
    
    return(0);
    
    }
    
    //+------------------------------------------------------------------+
    
    //| Custom indicator deinitialization function                       |
    
    //+------------------------------------------------------------------+
    
    int deinit()
    
    {
    
    //----
    
    
    //----
    
    return(0);
    
    }
    
    //+------------------------------------------------------------------+
    
    //| Custom indicator iteration function                              |
    
    //+------------------------------------------------------------------+
    
    int start()
    
    {
    
    
    double a,ma,w1,w2,w3,w4,cycle,x,grc,c,b,pi;
    
    
    int i,limit,phase;
    
    int flag;
    
    int counted_bars = IndicatorCounted();
    
    if(counted_bars < 0)
    
    return(-1);
    
    
    limit=Bars-counted_bars-1;
    
    
    
    for( i=limit; i>=0; i--) {
    
    
    if (day==TimeDay(Time[i]) && month==TimeMonth(Time[i]) && year==TimeYear(Time[i]) && hour==TimeHour(Time[i]) && minute==TimeMinute(Time[i])){
    
    flag=1;
    
    
    }
    
    if( flag==0) {
    
    Hurst[i]=EMPTY_VALUE;
    
    }
    
    else
    
    {
    
    a=a+1;
    
    x=(360/cyclelength)*a;
    
    phase=-90;
    
    pi=3.1415926535;
    
    
    w1=MathSin(((8*x+phase)*pi)/180);
    
    w2=2*MathSin(((4*x+phase)*pi)/180);
    
    w3=3*MathSin(((2*x+phase)*pi)/180);
    
    w4=4*MathSin(((x+phase)*pi)/180);
    
    if (Ncicli==3) {
    
    w1=MathSin(((12*x+phase)*pi)/180);
    
    w2=2*MathSin(((6*x+phase)*pi)/180);
    
    w3=3*MathSin(((3*x+phase)*pi)/180);
    
    w4=4*MathSin(((x+phase)*pi)/180);
    
    }
    
    cycle=(w1+w2+w3+w4);
    
    grc=0.01029;
    
    c=(grc*trend*1);
    
    b=b+c;
    
    Hurst[i]=(cycle+b+10)*((sup-inf)/15)+inf;
    
    }
    
    
    }
    
    
    return(0);
    
    }
    
    //+-----------------------------+
    #20871 quote
    Nicolas
    Keymaster
    Master

    Ho aperto un argomento specifico per questa nuova richiesta. Si prega di fare un tema per ogni richiesta! 🙂
    Ti dispiacerebbe dirci che cosa è questo indicatore su tutti? Si prega di fornire almeno il file .mq4 originale e alcuni screenshot, grazie.

    #20951 quote
    tatankayotanka
    Participant
    Senior

    E’  un indicatore ciclico,che si attacca al grafico… e ti mostra la previsione… va settato..anche questo a piacimento…

    #20973 quote
    Nicolas
    Keymaster
    Master

    Questo è ciò che ottengo quando convertirlo in ProRealTime. Non so se è preciso per voi. Non è possibile trarre curva nel futuro (a destra del prezzo) con ProBuilder, quindi la curva disegnata sotto del prezzo se già la previsione secondo la formula. Spero che sia d’aiuto.

    start = 20000101
    
    inf=18000
    sup=21000
    cyclelength=60
    trend=0
    Ncicli=2
    
    if date>=start then
    a=a+1
    x=(360/cyclelength)*a
    
    phase=-90
    pi=3.1415926535
    w1=Sin(((8*x+phase)*pi)/180)
    
    w2=2*sin(((4*x+phase)*pi)/180)
    
    w3=3*sin(((2*x+phase)*pi)/180)
    
    w4=4*sin(((x+phase)*pi)/180)
    
    if (Ncicli=3) then
    w1=sin(((12*x+phase)*pi)/180)
    w2=2*sin(((6*x+phase)*pi)/180)
    w3=3*sin(((3*x+phase)*pi)/180)
    w4=4*sin(((x+phase)*pi)/180)
    endif
    
    ccycle=(w1+w2+w3+w4)
    
    grc=0.01029
    
    c=(grc*trend*1)
    
    b=b+c
    
    Hurst=(ccycle+b+10)*((sup-inf)/15)+inf
    endif
    
    return hurst as "Hurst cycle"
    #21036 quote
    tatankayotanka
    Participant
    Senior

    Si si non e proprio la stessa cosa ma mi è d’aiuto . non e possibile inserirlo insieme al prezzo?

    #21043 quote
    Nicolas
    Keymaster
    Master

    Este es exactamente el mismo código que el del código metatrader que compartes en esta publicación. La captura de pantalla que publicas en tu anterior no es de una plataforma metatrader sino de otra, por lo que no debería ser el mismo indicador.
    Puesto que este indicador convertido no comparte la misma escala, no se puede agregar en precio pero solamente como oscilador en una ventana separada.
    Para calcular el ciclo de Hurst, los datos deben comenzar a partir de una fecha definida, y eso es lo que hay que cambiar en la línea 1 con la variable “start”.

    #21084 quote
    tatankayotanka
    Participant
    Senior

    Ok grazie

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Hurst indicator MT4 conversione


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 01/11/2017
Status: Active
Attachments: No files
Logo Logo
Loading...