¿Anulación de los indicadores estándar? - página 6

 
Se ha detenido, no puede encontrar el error en el algoritmo de comprobación.
 
Hice mi script de prueba
//+------------------------------------------------------------------+
//|                                                   CheckiTime.mq4 |
//|                                                             Rosh |
//|                        http://www.metaquotes.ru/forum/7790/page3 |
//+------------------------------------------------------------------+
#property copyright "Rosh"
#property link      "http://www.metaquotes.ru/forum/7790/page3"
#property show_inputs

extern string Currency1="GBPUSD";
extern string Currency2="EURUSD";
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
  string Currency;
  datetime AnotherTime;
  //datetime RightTime;
  int errorCounter;
  int AnotherBar,RightBar;
  int handle= FileOpen("CheckiTime.csv",FILE_CSV|FILE_WRITE,';');
  if (handle<0) Print("Ошибка открытия файла ",GetLastError());
   else FileWrite(handle,"index","Time[index]","AnotherBar","RightBar");
  
  if (Symbol()==Currency1) Currency=Currency2; else Currency=Currency1;
  int limit=MathMin(Bars,iBars(Currency,Period()));
//----
   for (int i=limit-1;i>=0;i--)   
      {
      AnotherBar=iBarShift(Currency,Period(),Time[i]);
      AnotherTime=iTime(Currency,Period(),AnotherBar);
      if (Time[i]!=AnotherTime &&(Time[i]==iTime(Currency,Period(),AnotherBar+1)||Time[i]==iTime(Currency,Period(),AnotherBar-1)))
         {
         errorCounter++;
         if (Time[i]==iTime(Currency,Period(),AnotherBar+1)) RightBar=AnotherBar+1; else RightBar=AnotherBar-1;
         if (handle>0) FileWrite(handle,i,TimeToStr(Time[i]),AnotherBar,RightBar);
         }
      }
   if (handle>0) FileClose(handle);   
   Print("Symbol=",Symbol(),"   Currency=",Currency);
   Print("Ошибок ",errorCounter);
//----
   return(0);
  }
//+------------------------------------------------------------------+



Lo ejecuté en EURUSD H4 (cuenta demo MIG), el resultado es
.

index Time[index] AnotherBar RightBar<br/ translate="no"> 2075 26.09.2005 0:00 1829 1828
1770 31.10.2005 0:00 1674 1673
1709 07.11.2005 0:00 1643 1642
1550 28.11.2005 0:00 1550 1549
1519 05.12.2005 0:00 1519 1518
1488 12.12.2005 0:00 1488 1487
1457 19.12.2005 0:00 1457 1456
1364 09.01.2006 0:00 1364 1363
1333 16.01.2006 0:00 1333 1332
1209 13.02.2006 0:00 1209 1208
1178 20.02.2006 0:00 1178 1177
1085 13.03.2006 0:00 1085 1084
513 24.07.2006 0:00 514 513
482 31.07.2006 0:00 483 482
389 21.08.2006 0:00 390 389
358 28.08.200608.08.2006 0:00 359 358
203 02.10.2006 0:00 204 203
172 09.10.2006 0:00 173 172
79 30.10.2006 0:00 80 79
48 06.11.2006 0:00 49 48
17 13.11.2006 0:00 18 17


Luego lo ejecuté en GBPUSD H4, el resultado es:
index Tiempo[index] AnotherBar RightBar
2639 21.03.2005 0:00 3168 3167
2609 28.03.2005 0:00 3137 3136
2339 30.05.2005 0:00 2858 2857
2309 06.06.2005 0:00 2827 2826
2279 13.06.2005 0:00 2796 2795
2249 20.06.2005 0:00 2765 2764
2083 27.07.2005 16:00 2593 2592
2082 27.07.2005 20:00 2591 2590
2081 28.07.2005 0:00 2589 2588
2080 28.07.2005 4:00 2587 2586
2079 28.07.2005 8:00 2585 2584
2078 28.07.2005 12:00 2583 2582
2077 28.07.2005 16:00 2581 2580
2076 28.07.2005 20:00 2579 2578
2075 29.07.2005 0:00 2577 2576
2074 29.07.2005 4:00 2575 2574
2073 29.07.20052005 8:00 2573 2572
2072 29.07.2005 12:00 2571 2570
2071 29.07.2005 16:00 2569 2568
2069 01.08.2005 0:00 2564 2563
2068 01.08.2005 4:00 2562 2561
2067 01.08.2005 8:00 2560 2559
2066 01.08.2005 12:00 2558 2557
2065 01.08.2005 16:00 2556 2555
2064 01.08.2005 20:00 2554 2553
2063 02.08.2005 0:00 2552 251
2062 02.08.2005 4:00 2550 2549
2061 02.08.2005 8:00 2548 2547
2060 02.08.2005 12:00 2546 2545
2059 02.08.2005 16:00 2544 2543
2058 02.08.2005 20:00 2542 2541
2057 03.08.2005 0:00 2540 2539
2056 03.08.2005 4:00 2538 2537
2055 03.08.2005 8:00 2536 2535
2039 08.08.2005 0:00 2503 2502
2022 10.08.2005 20:00 2469 2468
2021 11.08.2005 0:00 2467 2466
2020 11.08.2005 4:00 2465 2464
2019 11.08.2005 8:00 2463 2462
2018 11.08.2005 12:00 2461 2460
2017 11.08.2005 16:00 2459 2458
2016 11.08.2005 20:00 2457 2456
2015 12.08.2005 0:00 2455 2454
2014 12.08.2005 453 2452
2013 12.08.2005 8:00 251 2450
2012 12.08.2005 12:00 2449 2448
2011 12.08.2005 16:00 2447 2446
2010 12.08.2005 20:00 2445 2444
2006 15.08.2005 12:00 2436 2435
2005 15.08.2005 16:00 2434 2433
2004 15.08.2005 20:00 2432 2431
2003 16.08.2005 0:00 2430 2429
2002 16.08.2005 4:00 2428 2427
2001 16.08.2005 8:00 2426 2425
2000 16.08.2005 12:00 2424 2423
1999 16.08.2005 16:00 2422 2421
1998 16.08.2005 20:00 2420 2419
1997 17.08.2005 0:00 2418 2417
1996 17.08.2005 4:00 2416 2415
1995 17.08.2005 8:00 2414 2413
1994 17.08.2005 12:00 2412 2411
1993 17.08.2005 16:00 2410 2409
1992 17.08.2005 20:00 2408 2407
1991 18.08.2005 0:00 2406 2405
1990 18.08.2005 4:00 2404 2403
1979 22.08.2005 0:00 2381 2380
1978 22.08.2005 4:00 2379 2378
1977 22.08.2005 8:00 2377 2376
1976 22.08.2005 12:00 2375 2374
1975 22.08.2005 16:00 2373 2372
1974 22.08.2005 20:00 2371 2370
1949 29.08.2005 0:00 2320 2319
1948 29.08.2005 4:00 2318 2317
1947 29.08.2005 8:00 2316 2315
1946 29.08.2005 12:00 2314 2313
1945 29.08.2005 16:00 2312 2311
1944 29.08.2005 20:00 2310 2309
1943 30.08.2005 0:00 2308 2307
1942 30.08.2005 4:00 2306 2305
1925 02.09.2005 0:00 2272 2271
1924 02.09.2005 4:00 2270 2269
1923 02.09.2005 8:00 2268 2267
1922 02.09.2005 12:00 2266 2265
1921 02.09.2005 16:00 2264 2263
1920 02.09.2005 20:00 2262 2261
1909 06.09.2005 16:00 2239 2238
1908 06.09.2005 20:00 2237 2236
1907 07.09.2005 0:00 2235 2234
1906 07.09.2005 4:00 2233 2232
1905 07.09.2005 8:00 2231 2230
1904 07.09.2005 12:00 2229 2228
1903 07.09.2005 16:00 2227 2226
1902 07.09.2005 20:00 2225 2224
1901 08.09.2005 0:00 2223 2222
1900 08.09.2005 4:00 2221 2220
1899 08.09.2005 8:00 2219 2218
1898 08.09.2005 12:00 2217 2216
1897 08.09.2005 16:00 2215 2214
1896 08.09.2005 20:00 2213 2212
1895 09.09.2005 0:00 2211 2210
1894 09.09.2005 4:00 2209 2208
1893 09.09.2005 8:00 2207 2206
1889 12.09.2005 0:00 2198 2197
1888 12.09.2005 4:00 2196 2195
1887 12.09.2005 8:00 2194 2193
1886 12.09.2005 12:00 2192 2191
1885 12.09.2005 16:00 2190 2189
1884 12.09.2005 20:00 2188 2187
1883 13.09.2005 0:00 2186 2185
1882 13.09.2005 4:00 2184 2183
1881 13.09.2005 8:00 2182 2181
1880 13.09.2005 12:00 2180 2179
1879 13.09.2005 16:00 2178 2177
1878 13.09.2005 20:00 2176 2175
1877 14.09.2005 0:00 2174 2173
1860 16.09.20052005 20:00 2140 2139
1844 21.09.2005 12:00 2107 2106
1843 21.09.2005 16:00 2105 2104
1842 21.09.2005 20:00 2103 2102
1841 22.09.2005 0:00 2101 2100
1840 22.09.2005 4:00 2099 2098
1839 22.09.2005 8:00 2097 2096
1838 22.09.2005 12:00 2095 2094
1837 22.09.2005 16:00 2093 2092
1836 22.09.2005 20:00 2091 2090
1835 23.09.2005 0:00
2088 1834 23.09.2005 4:00 2087 2086
1833 23.09.2005 8:00 2085 2084
1832 23.09.2005 12:00 2083 2082
1831 23.09.2005 16:00 2081 2080
1830 23.09.2005 20:00 2079 2078
1811 28.09.2005 20:00 2042 2041
1810 29.09.2005 0:00 2040 2039
1809 29.09.2005 4:00 2038 2037
1808 29.09.2005 8:00 2036 2035
1807 29.09.2005 12:00 2034 2033
1806 29.09.2005 16:00 2032 2031
1805 29.09.2005 20:00 2030 2029
1804 30.09.2005 0:00 2028 2027
1803 30.09.2005 4:00 2026 2025
1802 30.09.2005 8:00 2024 2023
1801 30.09.2005 12:00 2022 2021
1800 30.09.2005 16:00 2020 2019
1799 30.09.2005 20:00 2018 2017
1794 03.10.2005 12:00 2009 2008
1793 03.10.2005 16:00 2007 2006
1792 03.10.2005 20:00 2005 2004
1791 04.10.2005 0:00 2003 2002
1790 04.10.2005 4:00 2001 2000
1789 04.10.2005 8:00 1999 1998
1788 04.10.2005 12:00 1997
1787 04.10.2005 16:00 1995 1994
1786 04.10.2005 20:00 1993 1992
1785 05.10.2005 0:00 1991 1990
1784 05.10.2005 4:00 1989 1988
1783 05.10.2005 8:00 1987 1986
1782 05.10.2005 12:00 1985 1984
1781 05.10.2005 16:00 1983 1982
1780 05.10.2005 20:00 1981 1980
1779 06.10.2005 0:00 1979 1978
1778 06.10.10.2005 4:00 1977 1976
1766 10.10.2005 0:00 1954 1953
1765 10.10.2005 4:00 1952 1951
1764 10.10.2005 8:00 1950 1949
1763 10.10.2005 12:00 1948 1947
1762 10.10.2005 16:00 1946 1945
1761 10.10.2005 20:00 1944 1943
1744 13.10.2005 16:00 1910 1909
1743 13.10.2005 20:00 1908 1907
1742 14.10.10.2005 0:00 1906 1905
1741 14.10.2005 4:00 1904 1903
1740 14.10.2005 8:00 1902 1901
1739 14.10.2005 12:00 1900 1899
1738 14.10.2005 16:00 1898 1897
1737 14.10.2005 20:00 1896 1895
1727 18.10.2005 8:00 1877 1876
1726 18.10.2005 12:00 1875 1874
1725 18.10.2005 16:00 1873 1872
1724 18.10.10.2005 20:00 1871 1870
1723 19.10.2005 0:00 1869 1868
1722 19.10.2005 4:00 1867 1866
1721 19.10.2005 8:00 1865 1864
1720 19.10.2005 12:00 1863 18624
1719 19.10.2005 16:00 1861 1860
1718 19.10.2005 20:00 1859 1858
1717 20.10.2005 0:00 1857 1856
1716 20.10.2005 4:00 1855 1854
1715 20.10.10.2005 8:00 1853 1852
1714 20.10.2005 12:00 1851 1850
1713 20.10.2005 16:00 1849 1848
1712 20.10.2005 20:00 1847 1846
1711 21.10.2005 0:00 1845 1844
1704 24.10.2005 0:00 1832 1831
1703 24.10.2005 4:00 1830 1829
1702 24.10.2005 8:00 1828 1827
1701 24.10.2005 12:00 1826 1825
1700 24.10.2005 16:00 1824 1823
1699 24.10.2005 20:00 1822 1821
1698 25.10.2005 0:00 1820 18192
1697 25.10.2005 4:00 1818 1817
1696 25.10.2005 8:00 1816 1815
1695 25.10.2005 12:00 1814 1813
1694 25.10.2005 16:00 1812 1811
1693 25.10.2005 20:00 1810 1809
1692 26.10.2005 0:00 1808 1807
1691 26.10.2005 4:00 1806 1805
1690 26.10.2005 8:00 1804 1803

26.10.2005 12:00 1802 1801
1688 26.10.2005 16:00 1800 1799 26.10.2005 20:00 1798 1797

27.10.2005 0:00 1796 1795
1685 27.10.2005 4:00 1794 1793 1684 27.10.2005 8:00 1792 1791
27.10.2005 12:00 1790 1789
27.10.2005 16:00 1788 1787
1681 27.10.2005 20:00 1786 1785
1680 28.10.2005 0:00 1784 1783
1679 28.10.2005 4:00 1782 1781
1678 28.10.2005 8:00 1780 1779
1673 31.10.2005 0:00 1771 1770
1672 31.10.2005 4:00 1769 1768
1671 31.10.2005 8:00 1767 1766
1670 31.10.2005 12:00 1765 1764
1669 31.10.2005 16:00 1763 1762
1668 31.10.2005 20:00 1761 1760
1667 01.11.2005 0:00 1759 1758
1666 01.11.2005 4:00 1757 1756
1665 01.11.2005 8:00 1755 1754
1664 01.11.2005 12:00 1753 1752
1663 01.11.2005 16:00 1751 1750
1662 01.11.2005 20:00 1749 1748
1661 02.11.2005 0:00 1747 1746
1644 04.11.11.2005 20:00 1713 1712
1627 09.11.2005 12:00 1680 1679
1626 09.11.2005 16:00 1678 1677
1625 09.11.2005 20:00 1676 1675
1624 10.11.2005 0:00 1674 1673
1623 10.11.2005 4:00 1672 1671
1622 10.11.2005 8:00 1670 1669
1621 10.11.2005 12:00 1668 1667
1620 10.11.2005 16:00 1666 1665
1619 10.11.11.2005 20:00 1664 1663
1618 11.11.2005 0:00 1662 1661
1617 11.11.2005 4:00 1660 1659
1616 11.11.2005 8:00 1658 1657
1615 11.11.2005 12:00 1656 1655
1614 11.11.2005 16:00 1654 1653
1613 11.11.2005 20:00 1652 1651
1610 14.11.2005 4:00 1647 1646
1609 14.11.2005 8:00 1645 1644
1608 14.11.2005 12:00 1643 1642
1607 14.11.2005 16:00 1641 1640
1606 14.11.2005 20:00 1639 1638
1605 15.11.2005 0:00 1637 1636
1604 15.11.2005 4:00 1635 1634
1603 15.11.2005 8:00 1633 1632
1602 15.11.2005 12:00 1631 1630
1601 15.11.2005 16:00 1629 1628
1600 15.11.2005 20:00 1627 1626
1599 16.11.2005 0:00 1625 1624
1598 16.11.2005 4:00 1623 1622
1597 16.11.2005 8:00 1621 1620
1596 16.11.2005 12:00 1619 1618
1595 16.11.2005 16:00 1617 1616
1594 16.11.2005 20:00 1615 1614
1580 21.11.2005 0:00 1588 1587
1579 21.11.2005 4:00 1586 1585
1578 21.11.2005 8:00 1584 1583
1577 21.11.2005 12:00 1582 1581
1575 21.11.2005 20:00 1577 1576
1549 28.11.2005 0:00 1551 1550
1270 30.01.2006 0:00 1272 1271
1239 06.02.2006 0:00 1241 1240
1208 13.02.2006 0:00 1210 1209
1177 20.02.2006 0:00 1179 1178
1146 27.02.2006 0:00 1148 1147
1115 06.03.2006 0:00 1117 1116
108 13.03.03.2006 0:00 1086 1085
1054 20.03.2006 0:00 1055 1054
482 31.07.2006 0:00 483 482
451 07.08.2006 0:00 452 451
420 14.08.2006 0:00 421 420
389 21.08.08.2006 0:00 390 389
358 28.08.2006 0:00 359 358
327 04.09.2006 0:00 328 327
296 11.09.2006 0:00 297 296
265 18.09.2006 0:00 266 265


Archivo de registro:

2006.11.15 22:40:07 CheckiTime GBPUSD,H4: CheckiTime GBPUSD,H4: Error 287
2006.11.15 22:40:07 CheckiTime GBPUSD,H4: Symbol=GBPUSD Currency=EURUSD
2006.11.11.15 22:40:06 CheckiTime GBPUSD,H4: Currency1="GBPUSD"; Currency2="EURUSD";
2006.11.15 22:40:05 CheckiTime GBPUSD,H4: cargado con éxito
2006.15 22:35:56 CheckiTime EURUSD,H4: eliminado
2006.11.15 22:35:56 CheckiTime EURUSD,H4: Errores 21
2006.11.15 22:35:56 CheckiTime EURUSD,H4: Symbol=EURUSD Currency=GBPUSD
2006.11.15 15 22:35:56 CheckiTime EURUSD,H4: Currency1="GBPUSD"; Currency2="EURUSD";
2006.11.15 22:35:54 CheckiTime EURUSD,H4: cargado con éxito
2006.11.15 22:35:30 Compilando 'CheckiTime'

 
Versión final del script de prueba

//+------------------------------------------------------------------+
//|                                                   CheckiTime.mq4 |
//|                                                             Rosh |
//|                        http://www.metaquotes.ru/forum/7790/page3 |
//+------------------------------------------------------------------+
#property copyright "Rosh"
#property link      "http://www.metaquotes.ru/forum/7790/page3"
#property show_inputs

extern string Currency1="GBPUSD";
extern string Currency2="EURUSD";
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
  string Currency;
  datetime AnotherTime;
  //datetime RightTime;
  int errorCounter;
  int AnotherBar,RightBar;
  int handle= FileOpen("CheckiTime.csv",FILE_CSV|FILE_WRITE,';');
  if (handle<0) Print("Ошибка открытия файла ",GetLastError());
   else FileWrite(handle,"index","Time[index]","AnotherBar","RightBar","Time","AnotherTime","Time-AnotherTime");
  
  if (Symbol()==Currency1) Currency=Currency2; else Currency=Currency1;
  int limit=MathMin(Bars,iBars(Currency,Period()));
//----
   for (int i=limit-1;i>=0;i--)   
      {
      AnotherBar=iBarShift(Currency,Period(),Time[i]);
      AnotherTime=iTime(Currency,Period(),AnotherBar);
      if (Time[i]!=AnotherTime &&(Time[i]==iTime(Currency,Period(),AnotherBar+1)||Time[i]==iTime(Currency,Period(),AnotherBar-1)))
         {
         errorCounter++;
         if (Time[i]==iTime(Currency,Period(),AnotherBar+1)) RightBar=AnotherBar+1; else RightBar=AnotherBar-1;
         if (handle>0) FileWrite(handle,i,TimeToStr(Time[i]),AnotherBar,RightBar,Time[i],AnotherTime,Time[i]-AnotherTime);
         }
      }
   if (handle>0) FileClose(handle);   
   Print("Symbol=",Symbol(),"   Currency=",Currency);
   Print("Ошибок ",errorCounter);
//----
   return(0);
  }
//+------------------------------------------------------------------+



Realmente no puedo explicar este comportamiento para las barras del domingo en las 4 horas (cuenta demo MIG).

 
Veo que a ti, Rosh, te gusta investigar a la hora de dormir. ;о)
Por cierto, ¿habrá más reflexiones, comprobaciones, investigaciones?
O ya es un resumen final y ya es el momento de llamar "¡Snee-Goo-ROCH-KA!!" es decir "¡¡¡rabot-chi-chi!!!" :o)
 
La última opción que queda por confirmar es hacer un script que dibuje líneas verticales en las barras equivocadas.
 
No entiendo muy bien, ¿para qué es eso?
 
Para ver si hay una relación entre que iTime() golpee de forma incorrecta y no se puedan poner líneas verticales en estos lugares.
 
¿Estoy en lo cierto al suponer que éste es el problema que he descrito antes? ¿Que la línea no estaba colocada? En caso afirmativo, esto se aplica no sólo a las líneas, sino a cualquier objeto de una barra en general. Del mismo modo, el punto de ajuste de cualquier objeto se "aleja" de las barras indicadas.
 
Así es - el fallo en la fijación de objetos gráficos en estas barras tiene una naturaleza común y tiene algo que ver (creo que sí) con el control del tiempo entre barras vecinas y la comprobación de este tiempo con Period().
 
Por lo que recuerdo, hay que prestar atención al volumen, al modelar en el probador para las barras con un volumen igual a 1 el probador por ejemplo para los días en lugar de la hora de inicio 00:00, daba la hora 23:59 (Slava en mi opinión explicó entonces por qué) y algunas otras características eran, para evitarlas ajusté el volumen y también "normalicé" la hora de inicio de la barra.

"¡¿Simulación?!"
"MetaTrader 4". Construye 181".
"MetaTrader 4 build 183".

no puedo recordar más detalles.
Razón de la queja: