Impulse - page 32

 
Artyom Trishkin:
Here I thought: probably your desire to simplify everything, to reduce to MA, and to make fast, and leads to hasty conclusions - "it will not work". I told you - first count the difference between neighboring ticks. We fill the array with price differences, not prices. But we're looking in passing for MA. Correction.

Honey, I've had this thing fixed for a long time now. I'm instructing you to make sure you don't get a worthless indicator here.

Now, about what you got in the end:

- speed averaging.

Even though you didn't get a MA in price, you got a MA in speed.What difference does it make?

If you don't know what the averaging bug is, then look closely:

(5+1)/2=3 //falls

(1+5)/2=3 //increases

OK, think for yourself, mathematician...

 
new-rena:

Honey, I've had this thing fixed for a long time now. I am instructing you so that you don't get a worthless indicator here.

Now, about what you got in the end:

- speed averaging.

Even though you didn't get a MA in price, you got a MA in speed.What difference does it make?

If you don't know what the averaging bug is, then look closely:

(5+1)/2=3

(1+5)/2=3 //increases

Well, think for yourself, mathematician...

That's a bit of a mouthful, mate. Being rude doesn't make people look good.

Now tell me what's in your formulas to what, mentor ...

ZS. I understand your aggression - someone did not give you their calculations, and you yourself do not understand, counting all in the world MAK, mathematician ... But you don't have to go off on people because of that - you look stupid.

 
Artyom Trishkin:

That's a bit of an overstatement, mate. Being rude doesn't make people look good.

Now tell me what's in your formulas to what, mentor...

ZS. I understand your aggression - someone did not give you their calculations, and you do not understand, considering everything in the world as mashki, mathematician ... You don't have to snap at people because of that - you look stupid.

The rudeness was mutual. And the fact that someone has not given something, it does not affect the creation of what is going on here. Where I asked for it, I've already explained everything and that person is advertising on all forums, not just here. People write that he is fed up with it.

Now to the point.

I gave the link yesterday and it is almost the main part of the indicator, its highlight, so to speak.

That is the number of ticks and direction of price movement is determined for the same interval of time and on its basis a trading signal is obtained. What is not clear here?

The main thing is not to average.

Thus, by the amount of ticks we judge about volatility, and by the sum of delta for the same time interval (as you correctly wrote above, the delta is the difference of prices between successive ticks) we judge about the direction of price movement, i.e. about the trend. And the delta can be either negative or positive. We add up what we have.

As a matter of fact, to calculate this indicator and to work, we need and need only N number of last ticks. Writing ticks in the history is not really necessary, except for testing.

The existing analogues of this indicator are designed as a speedometer.

 
new-rena:

About the rudeness - it was mutual. And the fact that someone didn't give something, it has no effect on the creation of what's going on here. Where I asked for it, I already explained everything and that man is advertising on all forums, not just here. People are writing that he is fed up with it.

Now to the point.

I posted the link here yesterday, so this is practically the main part of the indicator, its highlight, so to speak.

That is the number of ticks and direction of price movement is determined for the same time interval and on its basis a trading signal is obtained. What is not clear here?

The main thing is not to average.

Thus, by the amount of ticks we judge about volatility, and by the sum of delta for the same time interval (as you correctly wrote above, the delta is the difference of prices between successive ticks) we judge about the direction of price movement, i.e. about the trend. And the delta can be either negative or positive. We add up what we have.

As a matter of fact, to calculate this indicator and to work, we need and need only N number of last ticks. Writing ticks into the history is not really necessary, maybe just for a test.

Existing analogues of such an indicator are in the form of a speedometer.

Is this this link? https://www.mql5.com/ru/forum/61389/page30#comment_1776762

ZS. About the reciprocal rudeness - that's you for nothing. I was not rude to you first.

Импульс
Импульс
  • www.mql5.com
Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий. - Страница 30 - Категория: автоматические торговые системы
 
Artyom Trishkin:

Is this the link? https://www.mql5.com/ru/forum/61389/page30#comment_1776762

ZS. You're wrong about the mutual rudeness. I wasn't rude to you first.

Yeah, but that's in 4-pc. From what I understand we're doing in 5.
 
Karputov Vladimir:

The basis for recording ticks is there.


File name format:

There are four columns in the file:


The question remains - how often new files should be started. I think every hour you should start every file. It will be easier to analyse.

add High,Low (or immediately count price changes) - when a tick is missed (for technical reasons) they change... i.e. a situation is possible when inside M1 Bid went down, and High went up

I think it happens during impulses and when the terminal/computer is working on something else :-)

 
Karputov Vladimir:

There was a recording of 600 ticks. This record (100 each) was spread over six charts. The charts show price and tick change rate (EMA10). All in all there is a reason to study the figures:







you are looking a bit, i.e. not at all..on the graphs you got some kind of differentiation error function. That is, you first read the velocity as a derivative (dx/dt), then you integrate it (by a different method) and compare it to the original.

hint: any MA is a de facto integral function

hint2: to see if you are moving in the right direction - take a simple SMA and move it half a period back. If you see something useful in the history, it means that speed and momentum are counted for a reason and you can dig deeper

 
new-rena:
Yeah, but it's written in 4-pc. I understand we're doing it in 5.

It makes no difference which platform to use. I asked Roman there, and wrote him codes in private, but failed to understand why he sets the size of the array to two million in init(), then resizes the array to zero in start(), then tries to fill it with index -1 (!!!), and only after that increases the variable SIZE by 1, which should index the array. Compare, this is what I suggested:

//+------------------------------------------------------------------+
//|                                                   FillArrays.mq4 |
//|              Copyright 2015, Artem A. Trishkin, Skype artmedia70 |
//|                       https://login.mql5.com/ru/users/artmedia70 |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, Artem A. Trishkin, Skype artmedia70"
#property link      "https://login.mql5.com/ru/users/artmedia70"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//|   Input variables                                                |
//+------------------------------------------------------------------+
input int NumberOfStorableTicks=20;       // Количество сохраняемых тиков
int numberOfStorableTicks; // Количество сохраняемых тиков
input int PeriodOfMA=5;                   // Период сглаживания
int periodOfMA; // Период сглаживания
input ENUM_MA_METHOD MaMethod=MODE_SMA;   // Метод усреднения МА

//+------------------------------------------------------------------+
//|   Global variables                                               |
//+------------------------------------------------------------------+
string symbol;    // Symbol()
int digits;       // Digits
//+------------------------------------------------------------------+
//|   Arrays                                                         |
//+------------------------------------------------------------------+
double      Mass_ticks[];
double      Mass_smoothed_values[];
//+------------------------------------------------------------------+
//|   Structures                                                     |
//+------------------------------------------------------------------+
   MqlTick struct_tick;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   symbol=Symbol();
   digits=(int)SymbolInfoInteger(symbol,SYMBOL_DIGITS);
   //---
   numberOfStorableTicks=(NumberOfStorableTicks<1)?1:NumberOfStorableTicks;
   periodOfMA=(PeriodOfMA<1)?1:PeriodOfMA;
   //---
   ArrayResize(Mass_ticks,numberOfStorableTicks);
   ArrayInitialize(Mass_ticks,0.0);
   ArrayResize(Mass_smoothed_values,numberOfStorableTicks);
   ArrayInitialize(Mass_smoothed_values,0.0);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   Comment("");
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   if(SymbolInfoTick(symbol,struct_tick)) {
      double tick_bid=struct_tick.bid;
      FillArrays(numberOfStorableTicks,tick_bid,Mass_ticks);
      }
   string txt="";
   for(int i=numberOfStorableTicks-1; i>=0; i--) {
      string itxt=IntegerToString(i);
      txt+="\nmass["+itxt+"]: "+DoubleToString(Mass_ticks[i],digits);
      }
   Comment(txt);
  }
//+------------------------------------------------------------------+
void FillArrays(int array_size, double price, double &mass_price[]) {
   //--- сместим данные в массиве влево
   for(int i=array_size-1; i>0; i--) {
      mass_price[i]=mass_price[i-1];
      }
   //--- запишем новый тик в массив
   mass_price[0]=price;
}
//+------------------------------------------------------------------+
void SmoothingDataArray(int array_size, int ma_period, int ma_shift, ENUM_MA_METHOD ma_method, double &mass_price[], double &mass_smoothing[]) {
   for(int i=array_size-1; i>=0; i--) {
      mass_smoothing[i]=iMAOnArray(mass_price,array_size,ma_period,ma_shift,ma_method,i);
      }
   }
//+------------------------------------------------------------------+

However, iMAOnArray() refuses to smooth it out. No matter how twisted it is, it's backwards and forwards. But it's not necessary for the purpose intended here. I guess...

Yes, I forgot. That's what Roman suggested:

//---------------------
extern int MaxDrawTicks=100;
extern int Num_Aver_of_Ticks=5;  
double     xBuffer_Time []; // Массив значений   динамический
                            // В котором индекс - номер тика, значение - это бид 
int SIZE=0;                 // Вспомогательная переменная для массива                                  
int tickCounter, tickCounter_Current; 
//+------------------------------------------------------------------+
int init()
  {   
//--- устанавливаем размер динамического массива
   if(ArrayResize(xBuffer_Time,2000000)<0) {Alert(" Ошибка в изменении размера массива времени поступления тиков "); return(false);}
//--- установим индексацию для буфера как в таймсерии для динамического массива
  // ArraySetAsSeries(xBuffer_Time,true);    
//---   Возвращает количество элементов указанного массива. 
   int S=ArraySize(xBuffer_Time);
   if (S>=0) Alert("Размер массива: ",S);
   else Print("Ошибка. Массив не создан ",S);        
   ArrayInitialize(xBuffer_Time, 0);
   return(0);
  }  
//+------------------------------------------------------------------+
int start()
  {  
   //ArrayResize(ValueArr,size);
   //ValueArr[size-1] = GetValue();
   //size++; 
 //----------------------------------------  
   ArrayResize(xBuffer_Time,SIZE);
   xBuffer_Time[SIZE-1] = Bid; //NormalizeDouble((iTime (_Symbol,1,0)-_start), 2); 
  
   if ( SIZE >= 0 && ArraySize(xBuffer_Time) < 2147483647)
      {
      Alert (" Значение xBuffer_Time[SIZE-1] = ", DoubleToStr(xBuffer_Time[SIZE-1],Digits) );
      Alert (" Значение SIZE = ", DoubleToStr(SIZE,2) );  
      } 
    SIZE ++;   
 //---------------------------------------      
//------------
   return(0);
  }
 
Artyom Trishkin:

I'll try a tableau:

tick 10
tick 9
tick 8
tick 7
tick 6
tick 5
tick 4
tick 3 tick 2
tick 1 tick 0
Future tick
X10
X9
X8
X7
X6
X5
X4
X3
X2
X1X0
XN0
X9X8
X7X6X5
X4X3
X2
X1
X0XN0
XN1

x0, x1, x2 define the current state (pink), the rest define the past state (light green). The data in the array is constantly shifting, and the newly arrived xn0 takes the place of the zero tick. So now the current state will be counted from x1, x0, xn0, and the tick x2 from the last time is shifted to the cells defining the previous state, making a small correction for that state. If we count everything together, then all first three ticks will be corrected, which seems rather crude to me.

There's something to this. Here is a screenshot of the tick chart:

Screenshot of a tick chart

Note the area enclosed by the big arrows.

And here is the processing of condition when the average increment of ticks (tick0, tick1, tick2) is greater than the average increment (tick3, tick4, tick5, tick6, tick7, tick8, tick9, tick10) and the increment is greater than zero:

Processing of the condition

 
Artyom Trishkin:

It makes no difference which platform to use. I asked Roman there, and wrote him codes in private, but failed to understand why he sets the size of the array to two million in init(), then resizes the array to zero in start(), then tries to fill it with index -1 (!!!), and only after that increases the variable SIZE by 1, which should index the array. Compare, this is what I suggested:

However, iMAOnArray() refuses to smooth it out. No matter how hard I twist it, it goes backwards and forwards. But it's not necessary for the purposes intended here. I guess...

OK. And where is the time interval analysis in your code and why did MA appear?

I've found a bug in my thing, too. It's not the same number of ticks during one and the same time interval. We should not lose such an indicator.

Maybe I'm wrong, as I haven't been using 5-Rka for a long time yet.