[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 259

 
but that's it.
//+------------------------------------------------------------------+
//|                                                      5 fkkjd.mq4 |
//|                      Copyright © 2009, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

//---- input parameters
extern double      urov_h1_1=1;
.....
extern double      urov_D_4=1;
extern double      urov_D_5=1;

double urov_h1[], urov_h4[], urov_D[];
int svechi_ball, urov_ball, stoh;
int i;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
   //*******
   urov_h1[0]= urov_h1_1;   urov_h1[1]= urov_h1_2;   urov_h1[2]= urov_h1_3;   urov_h1[3]= urov_h1_4;
   urov_h1[4]= urov_h1_5;   urov_h1[5]= urov_h1_6;   urov_h1[6]= urov_h1_7;   urov_h1[7]= urov_h1_8;
   urov_h1[8]= urov_h1_9;   urov_h1[9]= urov_h1_10;  urov_h1[10]= urov_h1_11; urov_h1[11]= urov_h1_12;
   urov_h1[12]= urov_h1_13; urov_h1[13]= urov_h1_14; urov_h1[14]= urov_h1_15;
   //*******
   urov_h4[0]= urov_h4_1;   urov_h4[1]= urov_h4_2;   urov_h4[2]= urov_h4_3;   urov_h4[3]= urov_h4_4;
   urov_h4[4]= urov_h4_5;
   //******* 
   urov_D[0]= urov_D_1;   urov_D[1]= urov_D_2;   urov_D[2]= urov_D_3;   urov_D[3]= urov_D_4;
   urov_D[4]= urov_D_5;
   //*******

  //+++++медвежье поглощение++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  for( i=0; i<15; i++)
   {
   if( medvejye_poglochenie( urov_h1[ i])==true)
      {
      svechi_ball=4;
      urov_ball=3;
      text( svechi_ball, urov_ball);
      }
   }
  /*bool medv_po_h1_1=medvejye_poglochenie(urov_h1_1);
  bool medv_po_h1_2=medvejye_poglochenie(urov_h1_2);
  ............
  bool medv_po_h1_15=medvejye_poglochenie(urov_h1_15);
  //**
   //****стохастик
  double st_2=iStochastic(Symbol(),60,6,1,2,MODE_EMA,0,MODE_MAIN,2);    
  double st_1=iStochastic(Symbol(),60,6,1,2,MODE_EMA,0,MODE_MAIN,1);    

  if(medv_po_h1_1==true || medv_po_h1_2==true || medv_po_h1_3==true || medv_po_h1_4==true || medv_po_h1_5==true || medv_po_h1_6==true
     || medv_po_h1_7==true || medv_po_h1_8==true || medv_po_h1_9==true || medv_po_h1_10==true || medv_po_h1_11==true || medv_po_h1_12==true
     || medv_po_h1_13==true || medv_po_h1_14==true || medv_po_h1_15==true)
      {
      svechi_ball=4;
      urov_ball=3;
      if(st_2>st_1 && st_2>70 && st_1>70) stoh=2;
      else if(st_2>st_1 && st_2<70 && st_1<70) stoh=1;
      else stoh=0;
      text(svechi_ball,urov_ball,stoh);
      }
  if(medv_po_h4_1==true || medv_po_h4_2==true || medv_po_h4_3==true || medv_po_h4_4==true || medv_po_h4_5==true)
      {
      svechi_ball=4;
      urov_ball=4;
      if(st_2>st_1 && st_2>70 && st_1>70) stoh=2;
      else if(st_2>st_1 && st_2<70 && st_1<70) stoh=1;
      else stoh=0;
      text(svechi_ball,urov_ball,stoh);
      }
  if(medv_po_D_1==true || medv_po_D_2==true || medv_po_D_3==true || medv_po_D_4==true || medv_po_D_5==true)
      {
      svechi_ball=4;
      urov_ball=5;
      if(st_2>st_1 && st_2>70 && st_1>70) stoh=2;
      else if(st_2>st_1 && st_2<70 && st_1<70) stoh=1;
      else stoh=0;
      text(svechi_ball,urov_ball,stoh);
      }*/
  return(0);
  }

no

Something is wrong in this piece of code, and I don't know what it is.

for( i=0; i<15; i++)
   {
   if( medvejye_poglochenie( urov_h1[ i])==true)
      {
      svechi_ball=4;
      urov_ball=3;
      text( svechi_ball, urov_ball);
      }
   }

Sincerely.

 
alsu >> :

double iCustom(string symbol, int timeframe, string name, ..., int mode, int shift)
Calculation of the specified custom indicator. The custom indicator must be compiled (file with EX4 extension) and located in terminal_directory\experts\indicators.
Parameters:
symbol - Symbol name of the symbol, on data of which the indicator will be calculated. NULL means current symbol.
timeframe - Period. Can be one of the periods of the chart. 0 means the period of the current chart.
name - Name of custom indicator.
... - List of parameters (if necessary). Transmitted parameters should correspond to the order of declaration and type of external (extern) variables of the custom indicator.
mode - Index of the indicator line. Can be from 0 to 7 and should correspond to the index, used by one of the SetIndexBuffer functions.
shift - Index of the value obtained from the indicator buffer (shift relative to the current bar by the specified number of periods back).
Example:


>> help!

THANK A HUGE THANK YOU I would never have found iCustom in>> MQL4 Reference - Technical Indicators - iCustom (searched elsewhere, but not here)

Thanks a HUGE THANK YOU again!

 

Greetings!

I am trying to teach MT4 to identify the bars which range exceeds ATR(60) on the chart:

extern inttern Quant_Bars=1000; // Number of bars


int start()
{
int Ind_Bar;

for(Ind_Bar=Quant_Bars-1; Ind_Bar>=0; Ind_Bar--)
{
Create(Ind_Bar);
}

return;
}
//--------------------------------------------------------------- 3 --
int Create(int Ind_Bar) // User-defined function to create an object

{
Color Color=Red; //Object colour
datetime T_Bar=Time [Ind_Bar]; // Bar open time
double O_Bar=Open [Ind_Bar]; // Bar open price
double C_Bar=Close[Ind_Bar]; // Closing price of a bar
double H_Bar=High [Ind_Bar]; // Bar maximum price
double L_Bar=Low [Ind_Bar]; // Minimum bar price
double A= iATR(Symbol(),0,60,Ind_Bar);


if((H_Bar-L_Bar)>A)
ObjectCreate("His_Name",OBJ_TREND,0,T_Bar,H_Bar,T_Bar,L_Bar);
return;
}

... For some reason, it fills only one bar (the first one on the left, in my opinion), although I should have it all within 1000-0 bars. Please advise where the error is?

 

I can't figure out where to connect the brackets...help me please!

	if((( b1+ b1_2)>0) || (( b2+ b2_2)>=0) || (( s1+ s1_2)<0) || (( s2+ s2_2)<=0))
	{
	if( T1green!=0 && T2red==0)
	}
	else 
	if( Flat!=0) return(0);
	{
	SigBuy=true;
	}
	if((( b1+ b1_2)>0) || (( b2+ b2_2)>=0) || (( s1+ s1_2)<0) || (( s2+ s2_2)<=0))
	{
	if( T1red!=0 && T2green==0)
	}
	else if( Flat!=0) return(0);
	{	
	SigSell=true;
	}

=>

'}' - unbalanced parentheses
'}' - unbalanced parentheses

 
Ibiss >> :

I can't figure out where to put the brackets...help me please!

=>

It's not two brackets that are missing, there is no structure at all:

if(){}else{}//вот так 

if()// или так 
  {}
else
  {}
// и в зависимости от необходимости строите структуру 
if()
  {if(){}else{}}
else
  {if(){}}// простым скопировал вставил 

and then put the right conditions and operators into the structure.

	if((( b1+ b1_2)>0) || (( b2+ b2_2)>=0) || (( s1+ s1_2)<0) || (( s2+ s2_2)<=0))
	{
	if( T1green!=0 && T2red==0)// что это условие должно разрешать ????????????
	}
	else 
	if( Flat!=0) return(0);//тут вылетаем по ретурну дальше код не исполняется 
	{
	SigBuy=true;// по какому условию выполняется этот оператор ???????????
	}
	if((( b1+ b1_2)>0) || (( b2+ b2_2)>=0) || (( s1+ s1_2)<0) || (( s2+ s2_2)<=0))
	{
	if( T1red!=0 && T2green==0)// что это условие должно разрешать ????????????
	}
	else if( Flat!=0) return(0);//тут вылетаем по ретурну дальше код не исполняется 
	{	
	SigSell=true;// по какому условию выполняется этот оператор ???????????
	}

pppppppp

 
OK. I'll give it a try, thanks!
 
Urain >> :

It's not two brackets that are missing, there is no structure at all:

and then add the required conditions and operators to the structure.

pppppppp


It doesn't work like that.

What should I do correctly for my case?

if(...........)//если условие выполнилось,то
{
if(T1green!=0 && T2red==0)//и это выполнилось..  ...это типо максд
}
else 
if(Flat!=0) return(0);//это пролетаем, выполняется следующее
{
SigBuy=true;// включение покупки
}
 
How do I put colour-coded codes in my posts?
 
is there any way to make a 10 minute candlestick chart?
 

Hello. Please help me to redo the Period Converter Opt.

Here's the gist of it.

For example, we form 8 hour bars (terminal time) from 1 hour bars. We get the series: 0, 8, 16, 0 hours, etc.

I would like to be able to set an offset in the Converter. This shift can be done in the number of bars of the TF on the basis of which the required one is formed. If it is formed on the basis of 1-hour, then the shift will be expressed in hours... If it is formed on the basis of 15-minute, then the shift will be 15, 30, 45 minutes....

In addition, the time in the terminal also differs from "my" time by 2 hours. => inconvenient to go to the terminal at 2am MSC.

So, when forming the 8-hour timeframe with an offset of +3 (for example) we will get a new series: 3, 11, 19, 3, etc. Or (-2) offset will give: 22, 6, 14, 22, etc. Although it may be possible to limit it to the plus

offset.


The purpose of the offset is to prevent the bar from forming completely during the trader's sleep period.


This is how I would like to refine Period Converter Opt.
Reason: