Fresh MQL5 code release – perfect for enhancing your MT4/MT5 strategies.

The functions offered here return the prices that linearly change with the time for a graphical object located in any chart window.
The functions are located in the body of a test script that visually demonstrates how a bar is being formed.
Experience adaptive trading with the Fluid Expert Advisor for MT4/MT5. Dynamic money management and trend detection. Click for info.
Concept.
Standard function ObjectGetValueByShift() returns the values in the points of bar opening time, i.e., discretely with the timeframe step
This is determined by passing of the parameter of the chart X-coordinate as (int) of the bar number.
Calling to the standard function ObjectGetValueByShift() within the bar forming time frame, we obtain the same value.
Standard function ObjectGetValueByShift() does not calculate the changes of Y-coordinate within the entire period of bar forming.
When creating ATSes that response to any intersections of the graphical object, namely of TrendLine, the "error" of tens of points may be accumulated.
Correspondingly, we will need some functions that would return the true value at every tick
ObjectGetDelta_PerBar(string "ObjectName") ObjectGetDelta_ByCurrent (string "ObjectName") ObjectGetValue_ByCurrent(string "ObjectName", int BarNumber) ObjectGetDelta_ByTimeShift(string "ObjectName", double TimeShift )
Function ObjectGetDelta_PerBar(string "ObjectName") returns the slant of a graphical object by 1 bar as calculated from the object coordinates, i.e., it returns delta = one-bar increment. returns zero for all times set to the right of zero bar. However, a graphical object may be located to the right of zero bar. This is why the length of the graphical object in bars is calculated as the difference between the object coordinates times, the result being divided by the timeframe. This allows us to operate with objects that step out of zero bar position.
Function ObjectGetDelta_ByCurrent (string "ObjectName") claculates the current value inside a bar by the time elapsed since the bar began.
Function ObjectGetValue_ByCurrent(string "ObjectName", int BarNumber )ObjectGetDelta_ByCurrent () and the value at the preset bar number, if this value isn't equal to zero.
This will be a true value for zero bar. However, on any other bar, this will be the values shifted by the time taken by zero-bar forming. I.e., if you call it with a bar number other than zero, it will show a smooth shift proportional to the time taken by zero-bar forming. In our opinion, this feature is convenient for the sake of ATS.
A zero value of the graphical object's price
ObjectGetDelta_ByTimeShift(string "ObjectName", doubleTimeShift
To build an ATS, it is convenient to have a function that would give you the value of Y-coordinate increment by a preset time, шт the past or in the future.
This script, when tested on demo/real М1 charts, demonstrates:
1. irregularity of incoming ticks;
2. delay of bar opening/drawing event due to no ticks;
3. temporarily absent bars and post-factum assigning their opening times to them.
For example:
Time[0]=1208396460 line[0]=162.5545 current value within bar 0=162.5300 line (- 1)=162.5273 delta by (1) bar=-0.0273 delta by (2) bars=-0.0545
72%
Time[0]=1208396400 line[0]=162.5818 current value within bar 0=162.5400 line (- 1)=162.5545 delta by (1) bar=-0.0273 delta by (2) bars=-0.0545
152%
Time[0]=1208396400 line[0]=162.5818 current value within bar 0=162.5500 line (- 1)=162.5545 delta by (1) bar=-0.0273 delta by (2) bars=-0.0545
127%
Recommendations:
Explanation: See results in "Expert Advisors" at the bottom, near "Journal".
When removing the script from a chart, there can be a delay produced by MT 4 taking some time for termination.
Level up your trading with professional RobotFX expert advisors and indicators. Visit robotfx.org for proven MT4/MT5 tools.
8080