Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

First independent community of traders

First independent community of traders Logo First independent community of traders Logo

First independent community of traders Navigation

  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • Buy Theme
  • Home
  • About Us
  • Blog
  • Contact Us
Home/ Questions/Q 2613
Next
In Process
vdn_gol
vdn_gol

vdn_gol

  • 1 Question
  • 1 Answer
  • 0 Best Answers
  • 20 Points
View Profile
  • 0
vdn_gol
Asked: December 26, 20202020-12-26T12:25:06+00:00 2020-12-26T12:25:06+00:00In: Forex Expert Advisors

Help me Refine the expert Advisor

  • 0

You need to get an adequate value on the last bar.

// M. M. Dubovikov et al. - The dimension of the minimum coverage and
/ / local analysis of fractal time series.

/ / - - - - authorship of the indicator
#property copyright "Copyright © 2008, Ilnur"
double Trand()
  {

   int n=5; / / interval
int nBars=100;  
int rates_total; / / number of history in bars on the current tick
int prev_calculated;/ / amount of history in bars on the previous tick
datetime time[];
double open[];
double high[100]; // price array of maximums of price for the indicator calculation
double low[100]; / / price array of price minimums for indicator calculation
double close[];
long tick_volume[];
long volume[];
int spread[];

/ / - - - -
double ibuffer indicator buffer[];
//----
    SetIndexBuffer(0,ibuffer);
//----
//=========== EMULATION OF INDICATOR BUFFERS ============|

int  ArSize=ArraySize(ibuffer);
   if(ArSize<iBars(_Symbol,tfTrand))
     {
      ArraySetAsSeries(ibuffer,false);
      ArrayResize(ibuffer,iBars(Symbol(),tfTrand));
      ArraySetAsSeries(ibuffer,true);
     }

   int bars=iBars(Symbol(),tfTrand);

   int i,j,k,nTotal;
   int ihigh,ilow,nInterval;
   double Delta, XC, YC,Sx, Sy, Sxx,Sxy;
/ / - - - - the last counted bar will be recalculated
static int nCountedBars;
   nCountedBars=bars-1;
   if(nCountedBars>0) nCountedBars--;

   if(nBars>0)
      nTotal = MathMin(nBars,MathMin(bars-nCountedBars,bars-1));
   else  nTotal = MathMin(bars-nCountedBars,bars-1);

/ / - - - - main cycle
of the for indicator(j=nTotal; j>=>0; j--)
     {
      Sx=0; Sy=0; Sxx=0; Sxy=0;
      for(i=0; i<=n; i++)
        {
         nInterval=MathPow(2,n-i);
         / / - - - - summing up the difference between the maximum and minimum prices in the interval
         for(Delta=0,k=0; k<MathPow(2,i); k++)
           {
            ihigh= iHighest(Symbol(),tfTrand,MODE_HIGH,nInterval,nInterval*k+j);
            ilow =  iLowest(Symbol(),tfTrand,MODE_LOW, nInterval,nInterval*k+j);
            Print("high[ihigh]="+high[ihigh]+" low[ilow]="+low[ilow]);
            Delta+=high[ihigh]-low[ilow];
           }
         / / - - - - calculate the coordinates of the variation on a double logarithmic scale
         XC = (n-i)*MathLog(2.0);
         Us = MathLog(Delta);
         //---- accumulate data for finding of the coefficients of the regression line using OLS
         Sx += XC;
         Sy += Us;
         Sxx += XC*XC;
         Sxy += XC*Us;
        }
/ / - - - - calculate the index of variation (coefficient of slope of the regression line)
      ibuffer[j]=-(Sx*Sy-(n+1)*Sxy)/(Sx*Sx-(n+1)*Sxx);
     }
return(ibuffer[0]);}

in the meantime, complete nonsense. SPS.

  • 2 2 Answers
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    2 Answers

    • Voted
    • Oldest
    • Recent
    1. vdn_gol

      vdn_gol

      • 1 Question
      • 1 Answer
      • 0 Best Answers
      • 20 Points
      View Profile
      vdn_gol
      2020-12-26T12:25:14+00:00Added an answer on December 26, 2020 at 12:25 pm

      Dmitiry Ananiev:
      Call the indicator via iCustom.

      Thanks for the idea. I just don’t want to carry around a bunch of spare parts. And optimization is more convenient.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. dimeon

      dimeon

      • 2 Questions
      • 25 Answers
      • 0 Best Answers
      • 74 Points
      View Profile
      dimeon
      2020-12-26T12:25:10+00:00Added an answer on December 26, 2020 at 12:25 pm

      Call the indicator via iCustom.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    Leave an answer

    Leave an answer
    Cancel reply

    Browse

    Sidebar

    Ask A Question

    Stats

    • Questions 504
    • Answers 2k
    • Posts 5
    • Comments 0
    • Best Answers 0
    • Users 681
    • Popular
    • Comments
    • Tags
    • forexcommunity

      Highlighting what’s important about questions & Answers on Discy Community!

      • 0 Comments
    • forexcommunity

      Introducing Keyboard Shortcuts, our first Labs feature

      • 0 Comments
    • forexcommunity

      Defining quality on Discy Engine — what a helpful answer ...

      • 0 Comments
    • forexcommunity

      Organizational and company accounts on Discy Engine the next step

      • 0 Comments
    • forexcommunity

      Hello world!

      • 0 Comments

    Related Questions

    • Brus Agell

      Правельный выбор

      • 0 Answers
    • pinupcasinoo

      Pin Up Casino

      • 0 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 2 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 0 Answers
    • c00l777

      Optimization results differ on different accounts

      • 3 Answers

    Users

    Leonardcig

    Leonardcig

    • 0 Questions
    • 0 Answers
    DennisByday

    DennisByday

    • 0 Questions
    • 0 Answers
    Haroldmeary

    Haroldmeary

    • 0 Questions
    • 0 Answers

    Footer

    First independent community of traders

    About

    An independent community of forex traders. This is where traders communicate. You can ask your questions and you will receive an answer to your question.
    • Terms of Use
    • Privacy Policy
    • Cookie Policy
    • Knowledge Base
    • Support

    © 2021 Forexcommunity.net. All Rights Reserved