Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 866

 
tara:

Y(n+1)=(Y(n)*n+x[n+1])/(n+1), where Y(i) is the moving average of the i values, x[i] is the value numbered i. Numbering of values as in timeseries.

You'll be very obliged if you'll ever tell me why you need all this.

//+------------------------------------------------------------------+
//|   simple moving average                                          |
//+------------------------------------------------------------------+
void CalculateSimpleMA(int rates_total,int prev_calculated,const double &price[])
  {
   int i,limit;
//--- first calculation or number of bars was changed
   if(prev_calculated==0)
   
     {
      limit=InpMAPeriod;
      //--- calculate first visible value
      double firstValue=0;
      for(i=0; i<limit; i++)
         firstValue+=price[i];
      firstValue/=InpMAPeriod;
      ExtLineBuffer[limit-1]=firstValue;
      ExtLineBufferFid[limit]=(firstValue*InpMAPeriod+price[i+1])/InpMAPeriod;
      Print(" ",ExtLineBufferFid[limit]);
     }

Thank you for your feedback. The method of tendential planimetry

InpMAPeriod = 13;

Result: the current price of 1.09 calculates 1.27

The period 13 to the price of 1.09 does not equal 1.27, what am I doing wrong?

 
Top2n:

Thank you for your feedback. Trending planimetry method

InpMAPeriod = 13;

Result: the current price of 1.09 calculates 1.27

The period 13 to the price of 1.09 does not equal 1.27, what am I doing wrong?


Is this a trending planimetric method? Maybetrending, in Russian?!
 
artmedia70:

Who breaks like that? You have to bang it against your knee ;)

And do it like this:

Thanks for the answer, I found it in the tutorial myself, only it still doesn't write. And where am I supposed to see the message if there is no location?

Haven't found it in the tutorial yet ( or missed it ). And in passing, please: I don't understand the difference between Print and Alert.

Can you tell me?

Thank you.

 
rapid_minus:

Thanks for the reply, I found it in the tutorial myself, only it still doesn't write. And where am I supposed to see the message if there is no location?

Haven't found it in the tutorial yet ( or missed it ). And in passing, please: I don't understand the difference between Print and Alert.

Can you tell me?

Thank you.

Print() prints the message in the "Experts" journal if you are in demo or real mode, if you are in visualization mode, it prints it in the "Journal" of the tester

Alert() prints the message window on the chart, if it is in demo or real mode, if it is in visualization mode in the Visualization mode, then in the "Journal" log of the Strategy Tester.

 
Top2n:

Thank you for your feedback. Trending planimetry method

InpMAPeriod = 13;

Result: the current price of 1.09 calculates 1.27

The period 13 to the price of 1.09 does not equal 1.27, what am I doing wrong?


1.(firstValue*InpMAPeriod+price[i+1])/InpMAPeriod;

2.(firstValue*InpMAPeriod+price[InpMAPeriod+1])/(InpMAPeriod+1);

The moving average can also be calculated a bit faster, since there are so many of them to be processed. Y[i]=Y[i+1]+(X[0]-X[N])/N

 

Hello. I have more than ten charts open in the window. I have one Expert Advisor active in all of them. How do I know the symbol of the chart that is currently active.

Symbol

Returns a text string with the name of the current financial instrument.

stringSymbol();


If I understand it correctly, it returns the symbol of the window, to which the Expert Advisor is attached. I need the symbol of the currently active window, how can I get it?
 
pycha:

Hello. I have more than ten charts open in the window. one Expert Advisor is active in all of them. How do I find out the chart symbol that is currently showing the active chart.

If I understand it correctly, it returns the symbol of the window, to which the Expert Advisor is attached. I need the symbol of the currently open window. How can I get it?
In which window do you have a lot of open charts?
 

I do not understand the question, in the program window

I need to know the symbol of the active chart. In the picture it is GBPUSD. How can I do it?

I need a function that will return GBPUSD to each open Expert Advisor in this example, regardless of the symbol.

 
pycha:

I do not understand the question, in the programme window

I need to find out the programme symbol of the active chart. In the picture it is GBPUSD. How can I do it?

The programme window is called the terminal. There are graphs (tools) in the terminal. Each chart (tool) can have several windows. What do you mean by all of this?

Reason: