[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 257

 
CLAIN:
mmm.... no way.... using "all ticks"... so the interesting thing is, buy opens on HIGH and sell on CLOSE... i don't understand what this is about?


Minutes in the tester consist of four ticks

 
Hello how to correctly square on µl4 ? 2^2 - is ^ the symbol of the degree?
 
Shniperson:
Hello how to correctly square on µl4 ? 2^2 - is the ^ symbol a power?
https://docs.mql4.com/ru/math
 
Shniperson:
Hello how do I correctly square an µl4 ? 2^2 - is ^ the symbol of the degree?

double MathPow( double base, doubleexponent)

The function returns the value of the base multiplied to the specified power.

Or use usual multiplication 2*2=4

Although you can make your own function for integer multiplication

 
Vinin:


Minutes in the tester consist of four ticks


hmm.... I can't say I'm 100% sure, but I think you're wrong. And my argument is as follows: when you look at the formation of a candle - it is not formed in 4 movements in the tester. Plus, even if it consists of 4 ticks, it can't happen that in 100% of cases the last sharp break is always formed on a high or on a close. (or can it?).

My idea of the strategy is the following: if price has changed by more than 1.5 pips - open.

 
CLAIN:


hmm.... I can't say I'm 100% sure, but I think you're wrong. And I have the following argument: when you look at the formation of the candle - it is not formed in 4 movements in the tester. Plus, even if it consists of 4 ticks, it can't happen that in 100% of cases the last sharp break is always formed on a high or on a close. (or can it?).

The idea in my strategy is as follows: if price has changed by more than 1.5 pips - open


There will be a very big difference between tester and real, and we can't compare it with demo.
 

hmmm... interesting information... i got it, i'll try it on demo, of course... but why can't the demo be compared to the real one? it seemed to me that it's the same thing, only the money is unreal.

If i dont know the price of the engine, i dont know how to open it. And how do i know the price of 2 or 3 ticks ago? I would really like to learn how to save them in an array, I even know how to write an array, but how to record the values of previous ticks - my manual says nothing =(

 
CLAIN:

And how do I know the price of 2 or 3 ticks back? I'd really like to learn how to save them to an array, I even know how to write an array, but how to write the values of previous ticks there - my tutorial doesn't say anything =(

Organise an array, and fill it by the stack principle.
 

The point is to average open-close over n candles

it just draws a downward pointing line

what is wrong ?

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red 

extern double n = 50;
double Buf_0[];

int init()
  {
 SetIndexBuffer(0,Buf_0);
 SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,2);    
    
   return(0);
  }

int start()
  {
   int    Counted_bars=IndicatorCounted();
      
   double v;
  int i=Bars-Counted_bars-1;
 
  while(i>=0)  
  {  v=0; 
          for(int k=1;k<=i+n-1;k++)
        {
      
        v=v+MathAbs(Open[k]-Close[k]);
       
        
      }
       Buf_0[i] = v/n;
       
       i--;
       }
 return;
 }
 
Bicus:
Organise the array, and fill it in according to the stack principle.
I wouldn't mind seeing an example of how to do this intelligently either.