Tick Indicator and EAs - page 24

To add comments, please log in or register
Sergey Golubev
Moderator
107324
Sergey Golubev  

Forum on trading, automated trading systems and testing trading strategies

MT4 & MT5 backtest

Sergey Golubev, 2017.02.17 20:53

If you are backtesting EA on MT5 using 'every tick based on real ticks' so it will be almost same with trading on MT5 platform with some particular broker (because it is based on actual historical data).

Example, read this thread: Why is it better MT5 than MT4?? Does it have fewer limitations ??? - this is the quote from the first post of the thread:

  • In MT5 you can backtesting robots with the closest possible conditions to the real market natively  (real tick data, real variable spreads, lag, slippage, etc). In MT4 you can't natively. You only can if you pay for a third-party software. If so, you also have to download history data from a few sources (there are many few, almost everyone uses the same source), transform it to MT4 format and open the platform through this third-party software in order to patch MT4 behavior. You take many hours to complete this process, and you have to repeat it every time you want to incorporate new data. 
    We have all seen hundreds of robots that obtained spectacular results in backtesting, but when operating in real account the results were very bad. This is mainly because they were made with conditions that had nothing to do with real market conditions.

For more information about it - read this summary.

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

As i know - some coders/traders are converting their MT4 EAs to MT5 just to backtest them and/or to find the settings with optimization to get the backtesting results that are closest to reality. 


Sergey Golubev
Moderator
107324
Sergey Golubev  

Tick Chart - indicator for MetaTrader 5 


The indicator displays the Ask and Bid, which are taken from the real tick history. Also, it is possible to evaluate the spread changes by visually comparing the Ask and Bid

Mark Ahrens
1241
Mark Ahrens  
VESTAXUS:

Program/Code Ind. Help - Every Tick Sound Change

Hello Forex-Tsd & Traders & especially coders,

Congrats on this Fanastic community, just joined, here to stay lol

Help With Creating/Coding a Sound Indicator - "Every Tick Sound"

I hope that this explains fully the project and please feel free to comment or send any recommendations. Thank you very much in advance!

Background: The idea is that i constantly can't monitor the charts with my 'eyes' but it could helpful to monitor the market using different sounds with my 'ears'.

Project:

1. To create a sound indicator for MT4

2. Six Audio short files

3. Every 1 tick UP triggers the first sound file "beep up 1"

4. Every 1 tick DOWN triggers sound file "beep down 1"

5. Every 5 ticks Jump UP triggers sound file "beep up 2"

6. Every 5 ticks Jump DOWN triggers sound file "beep down 2"

7. Every 7 ticks Jump UP triggers sound file "beep up 3"

8. Every 7 ticks Jump Down triggers sound file "beep down 3"

Here is a Diagram Explanation to explain further - Attachment or on this PhotoBucket Link

Result -an alternative way to track/monitor the market tick movement, volatility (tick jumps) with different sounds that identify market price 'sound' action. This could as well help the trader determine the speed of the market and Avoid trading when the market is 'dead' 1-3 pip range.

This project will be free to use for all users

Resources:

- Sound File 1&2 - Zip files with (wav./mp3) attached


Has this Indicator been created?

Thanks, Mark

Sergey Golubev
Moderator
107324
Sergey Golubev  

Generate Tick Data

The forum

  1. GenerateTickData indicator - the post. It is the indicator to generate tick data (so place it in indicators folder) and it will work the same regardless of the time frame it is attached to. It will create a file that is starting with "_t" and adds symbol name after it. It "pretends" to be 1 minute chart, but it is not (of course ). Just open that symbol as offline chart and use it (the indicator must be active on some other chart in order to get "live" ticks). 
  2. Tick Indicator and EAs - the key thread  
  3. What is a TICK? - small thread with the explanation
  4. GenerateTickData - final indicator is on this post. Two options added:
    - ResetData - Added it in order to be able to "start from the beginning" (if you turned off your PC and a "time gap" occurs since there is no way to reconstruct tick data or any other reason when you do not want the data to be appended to already existing tick data) If you set this parameter to true, it will start a new tick data history.
    - ShowComment - It is the fastest way to show that it is working, so if you set it to true it will simply comment in the upper left corner that tick data is saved and a time when it was saved.
  5. Tick Data v1.00 indicator - the post. It is next version of GenerateTickData indicator: Added an option to choose how many ticks do you want per bar. Indicator is differentiating 2 basic types:
    - When required number of ticks per bar is 1, it records bid as low and ask as high, so you can have a sort of a "spread control" (since now you can see those ticks as lines but you can see them as bars too, as in this example );
    - When required number of ticks is greater than 1 then you are getting a sort of "equi-volume" charts (every bar is having a same volume when you turn the volume display on) High, low, open and close are constructed from a Bid.
  6. Tick Data v1.01 indicator - the post. This is improved version of Tick Data v1.00 indicator. This indicator can produce an offline chart of ticks simulated by metatrader and if you are testing an EA that depends on a narrow take profits or stops, this indicator shows you that back test can not be trusted at all. The indicator is, apart from having the possibility of recording test data, a revised version with some code optimization and some corrections.
  7. Tick Data v1.02 indicator - the post. It is the Newer version of tick data indicator. Unlike before (previous versions) this one make difference as of how many ticks is chosen and saves it accordingly. As before the name of the symbol for offline charts is "_t"+symbol name, but the difference is in the "time frame" it is saved as : the time frame is in fact number of ticks. So you are going to artificially get a 1 minute, 10 minute, nnn minutes tick charts where minutes are in fact number of ticks per bar. The limitation (due to metatrader naming conventions) is that the maximum number of ticks can be 9999. All the charts are updated live (one 1 tick chart and two 10 tick charts) and both indicators (for 1 tick and 10 tick) are attached to the same chart.
  8. Tick Data v1.03 indicator - the post. It is the next version of Tick Data indicator. A parameter to add a completely new option - there is some explanation of the author: "It occurred to me that a tick chart is a bit "illogical" - illogical in a sense that current bar open is very rarely previous bar open (since it was opened at first tick after a current bar reaches tick count), not when the previous bar was closed. So decided to add on option that takes care of it : UsePreviousCloseForOpen - if set to true, then the open is determined from previous bar close not the first ticks after the bar opens, if set to false it work as before".

The articles

CodeBase

Sergey Golubev
Moderator
107324
Sergey Golubev  

============

Tick Tools

  1. Tick tools - key thread with many tick indicators.
  2. Tick indicators and EAs thread 
  3. PipsChart indicators thread 
  4. Ferret the PipsChart Trader EA: the thread 
============
BeautifulSkies
4
BeautifulSkies  
Good day,


I have a short question about this tick indicator. It's the one that counts up ticks and down ticks for every candle. This is the display of the net difference.

Sometimes, pretty frequently, the history of the recorded tick action is deleted.

So, for example, I could have lots of records accumulated like in the first pic. Then when I check the chart later again, the records would have been deleted and it started over, like in the second pic. The frequency of deletion seems random.

What is needed in the code to keep everything indefinitely?


Best regards.


#property indicator_separate_window
#property indicator_buffers 3

#property indicator_color1 DeepSkyBlue
#property indicator_color2 Violet
#property indicator_color3 Gold

double TickUp[];
double TickDn[];
double TickNet[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorShortName("Tick Action");
   
   SetIndexBuffer(0,TickUp);
   SetIndexBuffer(1,TickDn);
   SetIndexBuffer(2,TickNet);
   
   SetIndexStyle(0,DRAW_HISTOGRAM,0,2);
   SetIndexStyle(1,DRAW_HISTOGRAM,0,2);
   SetIndexStyle(2,DRAW_HISTOGRAM,0,2);
      
   SetIndexEmptyValue(0,0.0);
   SetIndexEmptyValue(1,0.0);
   SetIndexEmptyValue(2,0.0);
   
   SetIndexLabel(0,"Tick Up");
   SetIndexLabel(1,"Tick Dn");
   SetIndexLabel(2,"Tick Net");
   
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  { 
  //Possible modifications
  /*You can export the past data to a file and load it on startup again 
  /to make the history is accessable after a restart of the client/indicator. */
  
  return(0);
  }
//+------------------------------------------------------------------+
//| Ticks Volume Indicator                                           |
//+------------------------------------------------------------------+

double lastTick = 0;
int start()
  {
     
    if(Bid < lastTick)
      TickDn[0]--;

    if (Bid > lastTick)
      TickUp[0]++;
     
    lastTick = Bid;
    
    TickNet[0] = TickUp[0]+TickDn[0];

//---
   return(0);
  }
//+------------------------------------------------------------------+
Files:
1.JPG 26 kb
2.JPG 17 kb
FX_ Hedge
37
FX_ Hedge  
Someone figured out a proper uptick/downtick ratio in relation to price movement indicator. One of the best I have seen...I always knew there were gems in that uptick/downtick info if the ratio in relation to price movement could be dialed in.


BUYERS absorbing a downtrend...
BUYERS
FX_ Hedge
37
FX_ Hedge  
BUYERS juicing an uptrend...
BUYERS in a trend
FX_ Hedge
37
FX_ Hedge  
SELLERS absorbing and uptrend...
SELLERS
BeautifulSkies
4
BeautifulSkies  
FX_ Hedge:
Someone figured out a proper uptick/downtick ratio in relation to price movement indicator. One of the best I have seen...I always knew there were gems in that uptick/downtick info if the ratio in relation to price movement could be dialed in.

Very elegant. Strongly agree with you that looking into this info and creating formulas with it seems to give ingenious results. Probably because it's volume behavior studied very finely, leading to higher extraction of information and thus a cutting edge. I'm still exploring this area.

I couldn't find that specific indicator. I'm estimating it could be something as simple as dividing the net pip movement sum of every occurring tick with the net tick count sum. It would make sense like this: the more pips price moved per +/- tick, the higher the result of the divided ratio would be, meaning there was more "punch" per tick in that direction. Then you net those ratios of the upside and downside and see which had more output.
To add comments, please log in or register