Impulse - page 21

 
Karputov Vladimir:
  1. Good. The tick arrival time can be recorded not in increments, but directly in microseconds since the start of the MQL5 program. That is how the pause between ticks will be calculated.
  2. The second field will then be the price of array close[] - that is Bid.
  3. I have some doubts concerning Ask. Is it worth to receive it? The indicator receives spread[] array - it can be written. The person who needs it will calculate Ask.
  4. File name in this format: Data_ticks_GBPUSD.f_2015.07.20 16_02_36.csv

Added: This turns out to be a table like this:

No backwards compatibility with terminal versions at all. For MT4 it has to be completely redone. What prevents you from recording the date and not some synthetic time? You can link the date to anything, use it without recalculating with anything. Why make a mess of it deliberately in the future? You don't know what else you'll have to do with time... And here we have to recalculate/convert it as well ...

What prevents us from writing the current Ask instead of array spread[], which is useless in MT4 ? Are you deliberately cutting your foot off up to the neck? :)))

 

Okay. This is the file format:

Время тика, микросекунд Время тика, секунд      Bid             Ask
76718                   20.07.2015 18:09        1.55962         1.55981
76838                   20.07.2015 18:09        1.55962         1.55981
190796                  20.07.2015 18:09        1.55961         1.55980
533045                  20.07.2015 18:09        1.55960         1.55979
989364                  20.07.2015 18:09        1.55961         1.55980
2058082                 20.07.2015 18:09        1.55960         1.55979
2397266                 20.07.2015 18:09        1.55961         1.55980
3498990                 20.07.2015 18:09        1.55962         1.55981
5276197                 20.07.2015 18:09        1.55962         1.55981
5276318                 20.07.2015 18:09        1.55962         1.55981
5714501                 20.07.2015 18:09        1.55967         1.55986
5825529                 20.07.2015 18:09        1.55968         1.55987
5825630                 20.07.2015 18:09        1.55968         1.55987
6095716                 20.07.2015 18:09        1.55969         1.55988
6419932                 20.07.2015 18:09        1.55968         1.55987
6795191                 20.07.2015 18:09        1.55969         1.55988
6972306                 20.07.2015 18:09        1.55968         1.55987
7017356                 20.07.2015 18:09        1.55967         1.55986
Is it good?
 
Roman Shiredchenko:

Anything to add on the subject...

There's a link to a video - they deleted it - they thought it was advertising.

How can I share the scalping strategy on which I am writing the indicators?

How can I place the youtube video in "interesting videos of July"?

I will not post the link - I will send it to Google: "The main features of the "Forex Speedometer" strategy are the absence of indicators and the simplicity of trading. Type of strategy - scalping. The strategy can be used on any currency pair, but it is advisable to choose highly volatile ones with small spread."

------------------------------------------------------------------------------------------

This topic was touched here as well. What to count the arrival time of each tick in the array and how to count the speed...

It's clear that there are variants. It is clear that in milliseconds the time of each caught tick will be visible... (How to use this afterwards? perhaps...)

Artem write again for the especially gifted... :-)

There it is offered exactly to count ticks per second - here such variant too was offered...

There's another question here - how to test it? My broker's ndd accounts with min. spread do not have demo. If I wanted to use my forex broker's demo and real nd account I would have checked the number of ticks - it is the same...

I.e. the question will be how to programmatically process the data collected on virtual trades in csv file eexcel and ticks... from real accounts.

The question will be to process the collected data for the virtual trades, in csv file in eexsv and ticks from the real accounts... :-)

How can I embed the ticks in csv file into history for MT4 strategy tester?

I tried something similar (not this strategy, I invented mine) not so long ago, but I abandoned it. I have to test such a system in real time, because tester only simulates ticks. I have been observing the Expert Advisor for two hours, then I copied the code for 5 minutes and so on, and then I got bored. The results are not very good, many deals with small profit, but one stoploss many times outweighs all the profits. As an alternative, one should use martingale to avoid accumulation of losses on equity. I have an Expert Advisor on a martin without that and its implementation is much simpler.
 

The basis for recording ticks is there.

//+------------------------------------------------------------------+
//|                                             IndTickCollector.mq5 |
//|                              Copyright © 2015, Vladimir Karputov |
//|                                           http://wmua.ru/slesar/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2015, Vladimir Karputov"
#property link      "http://wmua.ru/slesar/"
#property version   "1.01"
#property indicator_chart_window
#property description "Индикатор хранит тики. Время тика, микросекунд, Время тика, секунд , Bid, Ask"
#property indicator_buffers 0
#property indicator_plots   0
//+------------------------------------------------------------------+
//| Индикатор расчитывает скорость прихода тиков.                    |
//+------------------------------------------------------------------+
//--- parameters
int file_handle; // хэндл файла
string FileName; // имя файла
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- open file
//--- время начала сбора тиков - текущее
   datetime time_start=TimeCurrent();
//--- откроем файл для записи значений индикатора (если его нет, то создастся автоматически)
   ResetLastError();
   FileName="Data_ticks_"+Symbol()+"_"+TimeToString(time_start,TIME_DATE|TIME_MINUTES|TIME_SECONDS)+".csv";
   StringReplace(FileName,":","-");
   file_handle=FileOpen(FileName,FILE_READ|FILE_WRITE|FILE_CSV);
   if(file_handle!=INVALID_HANDLE)
     {
      PrintFormat("Файл %s открыт для записи",FileName);
      PrintFormat("Путь к файлу: %s\\MQL5\\Files\\",TerminalInfoString(TERMINAL_DATA_PATH));
      //--- запишем название колонок
      FileWrite(file_handle,"Время тика, микросекунд","Время тика, секунд","Bid","Ask");
     }
   else
      PrintFormat("Не удалось открыть файл %s, Код ошибки = %d",FileName,GetLastError());
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate (const int rates_total,      // размер массива price[]
                 const int prev_calculated,  // обработано баров на предыдущем вызове
                 const int begin,            // откуда начинаются значимые данные
                 const double& price[]       // массив для расчета
                 )
  {
   ulong microsecond_count=GetMicrosecondCount(); // зафиксировали вход в OnCalculate()
   int start=0;
   if(prev_calculated!=0) // работаем только на пришедших тиках, так как на истории нет времени тиков
     {
      MqlTick last_tick;
      //---
      if(SymbolInfoTick(Symbol(),last_tick))
        {
         FileWrite(file_handle,microsecond_count,last_tick.time,
                   DoubleToString(last_tick.bid,Digits()),DoubleToString(last_tick.ask,Digits()));
        }
      else Print("SymbolInfoTick() failed, error = ",GetLastError());
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- закрываем файл
   FileClose(file_handle);
   PrintFormat("Данные записаны, файл %s закрыт",FileName);
//--- очищаем комментарии
   Comment("");
  }
//+------------------------------------------------------------------+


File name format:

Data_ticks_GBPUSD.f_2015.07.21 12-06-14.csv

The file has four columns:

Время тика, микросекунд Время тика, секунд      Bid             Ask
76718                   20.07.2015 18:09        1.55962         1.55981
76838                   20.07.2015 18:09        1.55962         1.55981
190796                  20.07.2015 18:09        1.55961         1.55980
533045                  20.07.2015 18:09        1.55960         1.55979
989364                  20.07.2015 18:09        1.55961         1.55980


Questions remain about how often to start new files. I think each file should be started every hour. This will make it easier to analyse later.

 
Karputov Vladimir:

The basis for recording ticks is there.

File name format:

The file has four columns:

The questions that remain are how often to start new files. I think each file should be started every hour. This way it will be easier to analyse later.

It's not technically optimal. First of all, why write microseconds? This format is better:

Время, DD.MM.YYY HH:mm:ss:sss     Bid    Ask
20.07.2015 18:09:323            1.55962  1.55981 

CSV format should be abandoned in favour of XML. The task of serializing Object To Xml <--> XML To Object data is obvious. In case of need it will be easy to add new parameters. To store by day of course. 1 file - 1 day of tick history.

 
As for the idea itself - of course it's complete nonsense (with all due respect). You are making an identity between volatility and momentum (directional movement). This is fundamentally wrong though. There is practically no such correlation and hence the chosen approach will lead nowhere.
 
Vasiliy Sokolov:
As for the idea itself - of course utter nonsense (with all due respect). You are making an identity between volatility and momentum (directional movement). This is fundamentally wrong though. There is practically no such correlation and hence the chosen approach will lead nowhere.

The main thing is to collect data on tics. This is the basis of the research. And already on this basis different models can be tested.

Added: And yes, there is still no clear definition of impulse.

 
Karputov Vladimir:

The main thing is to collect data on tics. This is like the basis of research. And already on this basis different models can be tested.

Added: And yes, there is still no clear definition of impulse.

To be more precise: there is no necessary clear formulation here... and after all it is a basis, really necessary basis... without such formulation everything will be shaky, wobbly...

For example, there is such a clear formulation in impulse engineering. I gave an example earlier. Of course, you can't limit yourself to just one picture. This theory is extensive, and it will be very useful for its application here.

 

I'll try once more to make my point clear...

Although very rough, it is still a picture that gives an idea:



The pulse parameters - variables - have to be determined on the fly.

 
Олег avtomat:

I'll try to explain my point one more time...

Although very crude, it is still a picture that gives an idea:



The parameters - variables - of pulses should be determined on the fly.

Oleg, where is the pulse in this picture? Then decompose it into tick-time components, instead of proposing a graph of days.
Reason: