[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 121

 

http://clip2net.com/s/2LkQp

Anything you can do to help... Greetings all! I need to put the settings for Fractals in the settings window, and they are in the function....

 
Allis:

http://clip2net.com/s/2LkQp


Anything you can do to help... Greetings all! I need to put the settings for Fractals in the settings window, and they are in the function....


Add ;


extern int Bars.left =5;

and in the next one too.

and comment out the lines below so they don't repeat

// int Bars.left =5;

// int Bars.righ =5;

 
BeerGod:

Add ;


extern int Bars.left =5;

and in the next one too

and comment out the lines below so they don't repeat

// int Bars.left =5;

// int Bars.righ =5;


Didn't I do it the way you wrote? I took it to the Externs and commented it out at the bottom of....

http://clip2net.com/s/2LlEi well that's where I actually started

//+------------------------------------------------------------------+
//|                                                                  |
//|                 Copyright © 1999-2008, MetaQuotes Software Corp. |
//|                                         http://www.metaquotes.ru |
//+------------------------------------------------------------------+
#property copyright "© 2007 Takbir"
#property link      "www.stigal.com"
//----
#define major   1
#define minor   1
//----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DarkGreen
#property indicator_color2 Maroon
#property indicator_width1  1
#property indicator_width2  1
extern int Bars.left =5     // надо что бы было здесь и соответственно в окошке настроек
extern int Bars.right =5    // надо что бы было здесь и соответственно в окошке настроек
//----
double UpperFr[];
double LowerFr[];
//----
int Bars.left=5;       //а оно здесь, да ещё участвует в формуле
int Bars.right=5;      //а оно здесь, да ещё участвует в формуле

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void init()
  {
   SetIndexBuffer(0, UpperFr);
   SetIndexBuffer(1, LowerFr);
   //
   SetIndexEmptyValue(0, 0);
   SetIndexEmptyValue(1, 0);
   //
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0, 159);
   //
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexArrow(1, 159);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void start()
  {
   int counted=IndicatorCounted();
   if (counted < 0) return(-1);
   if (counted > 0) counted--;
   int limit=Bars-counted;
//-----
   double dy=0;
     for(int i=1; i<=20; i++) 
     {
      dy+=0.3*(High[i]-Low[i])/20;
     }
   for(i=1+Bars.right; i<=limit+Bars.left; i++)
     {
      UpperFr[i]=0;
      LowerFr[i]=0;
//----
      if (IsUpperFr(i)) UpperFr[i]=High[i] + dy;
      if (IsLowerFr(i)) LowerFr[i]=Low[i] - dy;
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
bool IsUpperFr(int bar)
  {
   for(int i=1; i<=Bars.left; i++)
     {
      if (bar+i>=Bars) return(false);

      if (High[bar] < High[bar+i]) return(false);
     }
   for(i=1; i<=Bars.right; i++)
     {
      if (bar-i < 0) return(false);
      if (High[bar] < High[bar-i]) return(false);
     }
//----
   return(true);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
bool IsLowerFr(int bar)
  {
   for(int i=1; i<=Bars.left; i++)
     {
      if (bar+i>=Bars) return(false);
      if (Low[bar] > Low[bar+i]) return(false);
     }
   for(i=1; i<=Bars.right; i++)
     {
      if (bar-i < 0) return(false);
      if (Low[bar] > Low[bar-i]) return(false);
     }
//----
   return(true);
  }
//+------------------------------------------------------------------+
 

Try this

//+------------------------------------------------------------------+
//|                                                                  |
//|                 Copyright © 1999-2008, MetaQuotes Software Corp. |
//|                                         http://www.metaquotes.ru |
//+------------------------------------------------------------------+
#property copyright "© 2007 Takbir"
#property link      "www.stigal.com"
//----
#define major   1
#define minor   1
//----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DarkGreen
#property indicator_color2 Maroon
#property indicator_width1  1
#property indicator_width2  1
extern int Bars.left =5;     // надо что бы было здесь и соответственно в окошке настроек
extern int Bars.right =5;    // надо что бы было здесь и соответственно в окошке настроек
//----
double UpperFr[];
double LowerFr[];
//----
//int Bars.left=5;       //а оно здесь, да ещё участвует в формуле
//int Bars.right=5;      //а оно здесь, да ещё участвует в формуле

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void init()
  {
   SetIndexBuffer(0, UpperFr);
   SetIndexBuffer(1, LowerFr);
   //
   SetIndexEmptyValue(0, 0);
   SetIndexEmptyValue(1, 0);
   //
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0, 159);
   //
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexArrow(1, 159);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void start()
  {
   int counted=IndicatorCounted();
   if (counted < 0) return(-1);
   if (counted > 0) counted--;
   int limit=Bars-counted;
//-----
   double dy=0;
     for(int i=1; i<=20; i++) 
     {
      dy+=0.3*(High[i]-Low[i])/20;
     }
   for(i=1+Bars.right; i<=limit+Bars.left; i++)
     {
      UpperFr[i]=0;
      LowerFr[i]=0;
//----
      if (IsUpperFr(i)) UpperFr[i]=High[i] + dy;
      if (IsLowerFr(i)) LowerFr[i]=Low[i] - dy;
     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
bool IsUpperFr(int bar)
  {
   for(int i=1; i<=Bars.left; i++)
     {
      if (bar+i>=Bars) return(false);

      if (High[bar] < High[bar+i]) return(false);
     }
   for(i=1; i<=Bars.right; i++)
     {
      if (bar-i < 0) return(false);
      if (High[bar] < High[bar-i]) return(false);
     }
//----
   return(true);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
bool IsLowerFr(int bar)
  {
   for(int i=1; i<=Bars.left; i++)
     {
      if (bar+i>=Bars) return(false);
      if (Low[bar] > Low[bar+i]) return(false);
     }
   for(i=1; i<=Bars.right; i++)
     {
      if (bar-i < 0) return(false);
      if (Low[bar] > Low[bar-i]) return(false);
     }
//----
   return(true);
  }
//+------------------------------------------------------------------+


 
BeerGod:

Try this, it compiles without errors, I haven't checked functionality)


Bummer.... I started with this one.... Exactly from this one... I posted the link.... And for some reason it didn't work... Thank you!
 
hoz:

Artem, you'd better drink juice like you did. I don't recommend beer... I don't advise it... :)

Eh... I haven't wanted to take alcohol for eight years now - not interested in it... :)

Thanks for your concern for your health ;)

 
hoz:

No. I just think unnecessary conditions and inspections are a waste of resources.
Yes... It's a lot easier to skip a few necessary checks than to report to Uncle Kolya...
 
Allis:

Bummer.... I started there.... Exactly from this one... I posted the link.... And for some reason it didn't work... Thank you!
It didn't work simply because you had to put a semicolon after the variable declaration and you didn't have any.
 

To look at the standard candlesticks from a different angle, I'm going to move the timeline to the left to the right. The hourly candlesticks should not start and end at 00 minutes, but at 10 or 20 minutes, for example.

It will give some additional information. The same on the daily candlesticks - shift by hours (e.g. open sessio). I have started to edit the csv archives in excel, but they are very time-consuming. Maybe someone can see some other solution to shift the minutes and recalculate the rest of the timeframe.

 
Operr:

To look at the standard candlesticks from a different angle, I am going to move the timeline to the left to the right. The hourly candlesticks should not start and end at 00 minutes, but at 10 or 20 minutes, for example.

It will give some additional information. The same on the daily candlesticks - shift by hours (e.g. open sessio). I have started to edit the csv archives in excel, but they are very time-consuming. Maybe someone can see some other solution to shift minutes and recalculate the rest of TF.


You may use period_converter script and modify candlestick cropping condition. For example, at a glance, to get candlesticks for x hours and 10 minutes:

      if(time0>=i_time+periodseconds || i==0)

replace with

      if(TimeMinute(time0)==10 || i==0)

Or so)))