[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 96

 
timbo >> :

Point

double Point
The point size of the current instrument in the currency of the quote.
See also MarketInfo().
Example:



The context was that if you attach this script to a currency other than GBPUSD, an algorithmic error occurs. Since Point is a point of the instrument in whose window the script was entered.

 

Hello. I wrote a multi-currency indicator based on WPR fast. But it doesn't update automatically and shows the last data 4 bars ago.

If you can, please fix the error.

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 Blue

//---- input parameters
extern int P = 14;
extern int n1 = 14;
extern int n2 = 14;
extern int CountBars=3500;

//---- buffers
double val1[];
double val2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- indicator line
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_ARROW, EMPTY);
   SetIndexArrow(0,108);
   SetIndexBuffer(0, val1);
   SetIndexEmptyValue(0,0.0);
   SetIndexStyle(1,DRAW_ARROW, EMPTY);
   SetIndexArrow(1,108);
   SetIndexBuffer(1, val2);
   SetIndexEmptyValue(1,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| AltrTrend_Signal_v2_2                                            |
//+------------------------------------------------------------------+
int start()
  { double F_u_EUR, F_u_GBP, F_d_EUR, F_d_GBP;
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if( counted_bars>0) counted_bars--;
   limit=Bars- counted_bars;
   for(int i=3; i< limit; i++)
{ 

	F_u_EUR=iCustom("EURUSD",15,"WPRfast", P, n1, n2,3000,0, i);
	F_d_EUR=iCustom("EURUSD",15,"WPRfast", P, n1, n2,3000,1, i);
	F_u_GBP=iCustom("GBPUSD",15,"WPRfast", P, n1, n2,3000,0, i);
	F_d_GBP=iCustom("GBPUSD",15,"WPRfast", P, n1, n2,3000,1, i);

if ( F_u_EUR>0&& F_u_GBP>0)
{
	val1[ i]=High[ i]+35*Point;
}
if (0> F_d_EUR&&0> F_d_GBP) 
{
	val2[ i]=Low[ i]-35*Point;
}


}
   return(0);
  }
//+------------------------------------------------------------------+
Files:
wprfast.mq4  3 kb
 
Why do you start the loop with int i=3?
 
Roger >> :
And why does your loop start with int i=3?

Oh, man, that's right. That's why the data was given three bars ago. I took the framework from the multivalent fractal and didn't notice.

How to make it refresh the data?

 
If you set it to zero, it will update immediately.
 
Thank you, Roger!
 

Is it possible to limit in MT4 (or programmatically) the receiving of quotes not every tick, but, let's say, once a minute?

Is it possible to accept quotes during the Sleep() procedure?

 
gorby777 писал(а) >>

Is it possible to limit in MT4 (or programmatically) the receiving of quotes not every tick, but, let's say, once a minute?

Is it possible to receive quotes during Sleep() procedure?

You can not limit the quotes reception. But we can process quotes with a certain periodicity.

Sleep() does not prevent from quotes arrival, it's just that the Expert Advisor does not see them without updating of the market environment.

 
Vinin >> :

It is not possible to limit the acceptance of quotes. But it is possible to process quotes with a certain periodicity.

Sleep() does not prevent quotes from coming in, the Expert Advisor just does not see them without updating the market environment.

Thanks, understood to the best of my ability. I was only interested in terms of limiting incoming traffic.

 
gorby777 >> :

Thanks, understood to the best of my ability. Was only interested in terms of limiting incoming traffic.

If traffic is critical to you, the most effective way is to limit the number of characters used in the Market Watch window.