Indicatore per prorealtime traslate

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #21367 quote
    papero76papero76
    Participant
    Senior

    E’ possibile trasformare questo per prorealtime?

     

    //—- indicator options
    #property indicator_separate_window
    #property indicator_buffers 1
    #property indicator_color1 Red
    #property indicator_level1 0.5
    //—- input parameters
    extern int n = 5;
    extern int nBars = 1000;
    //—- indicator buffers
    double ibuffer[];

    #define LOG_2_0 0.69314718055994530941723212145818 //MathLog(2.0);

    //+——————————————————————+
    //| Custom indicator initialization function |
    //+——————————————————————+
    int init()
    {
    //—- drawing settings
    SetIndexBuffer(0,ibuffer);
    SetIndexStyle(0,DRAW_LINE);
    SetIndexDrawBegin(0,Bars-nBars);
    SetIndexLabel(0,”iVAR”);
    //—- name for DataWindow and indicator subwindow label
    IndicatorShortName(“iVAR(“+n+”)”);
    return(0);
    }
    //+——————————————————————+
    //| Custom indicator iteration function |
    //+——————————————————————+
    int start()
    {
    int i, j, k, kCount, nTotal, nCountedBars = IndicatorCounted();
    int ihigh, ilow, nInterval, nIntervalStart;
    double Delta, Xc, Yc, Sx, Sy, Sxx, Sxy;
    //—- last counted bar will be recounted
    if(nCountedBars==0) nTotal = nBars;
    if(nCountedBars>0) nTotal = Bars-nCountedBars-1;
    //—- main loop
    for(j=nTotal; j>=0; j–)
    {
    Sx = 0; Sy = 0; Sxx = 0; Sxy = 0;
    for(i=0; i<=n; i++)
    {
    nInterval = 1 << (n-i); //MathPow(2,n-i);
    kCount = 1 << i; //MathPow(2,i);
    //—- summarise differences of the maximum and minimum prices on an interval
    for(Delta=0, k=0; k<kCount; k++)
    {
    nIntervalStart = nInterval*k+j;
    ihigh = iHighest(Symbol(),0,MODE_HIGH,nInterval,nIntervalStart);
    ilow = iLowest(Symbol(),0,MODE_LOW,nInterval,nIntervalStart);
    Delta += High[ihigh]-Low[ilow];
    }
    //—- compute coordinate of variation [Xc,Yc] in double logarithmic scale
    Xc = (n-i)*LOG_2_0; //MathLog(2.0);
    Yc = MathLog(Delta);
    //—- accumulate data for finding of factors of line of regress by means of LMS (least mean squares)
    Sx += Xc;
    Sy += Yc;
    Sxx += Xc*Xc;
    Sxy += Xc*Yc;
    }
    //—- compute variation index (slope of the line of regress)
    ibuffer[j] = -(Sx*Sy-(n+1)*Sxy)/(Sx*Sx-(n+1)*Sxx);
    }
    return(0);

    #21375 quote
    NicolasNicolas
    Keymaster
    Legend

    Ti dispiacerebbe dirci che cosa è questo indicatore su e screenshot per favore? Questo tipo di indicatore potrebbe essere stata già posta da qualche parte nel sito. Grazie.

    #21438 quote
    papero76papero76
    Participant
    Senior

    Nicolas grazie della risposta, sinceramente non ne ho idea, l ‘ho preso in un forum russo. 🙂

    #21504 quote
    NicolasNicolas
    Keymaster
    Legend

    Quindi vuoi che passo ore a tradurre un indicatore non si ha la minima idea di che cosa si tratta? È questo grave?

    #21614 quote
    papero76papero76
    Participant
    Senior

    ore? no assolutamente se è una questione di qualche minuto ok , altrimenti non fa niente

Viewing 5 posts - 1 through 5 (of 5 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

Indicatore per prorealtime traslate


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
papero76 @papero76 Participant
Summary

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

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