void CalculateSimpleMA(int rates_total,int prev_calculated,constdouble &price[])
{
int i,limit;
//--- first calculation or number of bars was changedif(prev_calculated==0)
{
limit=InpMAPeriod;
//--- calculate first visible valuedouble firstValue=0;
for(i=0; i<limit; i++)
firstValue+=price[i];
firstValue/=InpMAPeriod;
ExtLineBuffer[limit-1]=firstValue;
ExtLineBufferFid[1]=(firstValue*InpMAPeriod-price[i-InpMAPeriod])/i-1; Добрый человек предоставил вот такую реализацию(sma99[i]=(sma100[i]*100-d[i-100])/99;), но что то не выходит!
Greetings, apologies for the repetition, but interesting question!)
HOW to calculate:
Having a Sliding Period (e.g. 16) calculate a period of 15, starting from a period of 16.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Suggestions-how to fix it?
Explain in human language, what do you want from this script?
Find the lowest/highest value of the Volume indicator from the beginning of the day until now.
If there is a new high/lowest value, it remembers the last one.
evillive,
Thank you for your attention :)
Find the lowest/highest value of the Volume indicator from the beginning of the day to the present.
If there is a new high/lowest value it will remember the last one.
This is probably best:
My comment does not show something, it prints fine...
Greetings, apologies for the repetition, but interesting question!)
HOW to calculate:
Having a Sliding Period (e.g. 16) calculate a period of 15, starting from a period of 16.
That's probably best:
My comment does not show something, print prints normally...
Hello evllive,
That's possible, but I don't need it. I need an array.
You can't see the comment because you use voidOnStart and I use intstart.
Here's what I wrote the other day in the comment file, written in Bulgarian.
I'll look into it today and see what we discussed.
Thanks for your feedback.
PS: I added another file.
File H_L- first indicator,file_6 in body explorer but only draws.
It's probably better this way:
Comment I have something does not show, print outputs normally...
Said and done. I haven't put it in arrays yet, but I'll do it once I've converted it to an external function.
The lines are drawn on the first window of the indicator-data, if it is for volumetric, it needs a data brother for volumetric.
This way I formalize the range of the Volumet into parts low, medium, high.
Good evening!
Can you tell me what's wrong with my first EA? Didn't display the messages at the time of the fracture:
//--------------------------------------------------------------------
extern Period_MA=8; // Period of calculated MA
//--------------------------------------------------------------------
int start() // Special function start
{
double MA_f, // MA value on 0 bar
MA_s, // MA value on 1 bar
MA_t, // MA value on 2 bar
//--------------------------------------------------------------------
// Access to the function tech.ind.
MA_f =iMA(NULL,0,Period_MA,0,MODE_SMA,PRICE_CLOSE,0);
MA_s =iMA(NULL,0,Period_MA,0,MODE_SMA,PRICE_CLOSE,1);
MA_t =iMA(NULL,0,Period_MA,0,MODE_SMA,PRICE_CLOSE,2);
//--------------------------------------------------------------------
if (MA_t>MA_s<MA_f)
Alert("Fracture in the middle downwards");// Message
if (MA_t<MA_s>MA_f)
Alert("Break in the middle from above");// Message
//--------------------------------------------------------------------
return; //exit from start()
}
//--------------------------------------------------------------------
Thank you!
Greetings, apologies for the repetition, but interesting question!)
HOW to calculate:
Having a Sliding period (e.g. 16) calculate period 15, starting from period 16.
Y(n+1)=(Y(n)*n+x[n+1])/(n+1), where Y(i) is moving average of i values, x[i] is value number i. Numbering of values as in timeseries.
You'll be very obliged if you'll ever tell me why you need all this.
Good evening!
Can you tell me what's wrong with my first EA? Didn't display the messages at the time of the fracture:
...Thanks!
if(MA_t>MA_s<MA_f)Who breaks it like that? You have to bend the knee ;)
Do like this:
if(MA_t>MA_s && MA_s<MA_f)