facioquo / stock-indicators-python

Stock Indicators for Python. Maintained by @LeeDongGeon1996
https://python.StockIndicators.dev
Apache License 2.0
208 stars 35 forks source link

getting all is None when using ZigZag Indicator #302

Closed mohammadhosseinzavvar closed 1 year ago

mohammadhosseinzavvar commented 1 year ago

When using the zigzag indicator, only None is returned

RatesM5 = MT5.copy_rates_from_pos(Pair, M5, 0, 100)
FrameRatesM5 = PD.DataFrame(RatesM5)
QuotesList = [
                            Quote(d,h,l) 
                            for d,h,l
                            in zip(FrameRatesM5['datetime'], FrameRatesM5['high'], FrameRatesM5['low'])
                           ]
ZigzagM5 = indicators.get_zig_zag(QuotesList, EndType.HIGH_LOW, 2)
             for X in range(0, len(ZigzagM5), 1):
                 print(ZigzagM5[X].zig_zag,' ',ZigzagM5[X].date,' ',ZigzagM5[X].retrace_high,' ',ZigzagM5[X].retrace_low)
DaveSkender commented 1 year ago

A few things to check in your setup for ZigZag

  1. Include close price in your quotes. While you selected high/low option, close price is still used to initialize this indicator.
  2. Make sure you’re providing enough quote history to cover any warmup periods. Some price patterns may take a while to find the first pivot. Also check your input quotes.
  3. Check your parameters. Some options will never produce a pivot.
DaveSkender commented 1 year ago

@mohammadhosseinzavvar were you able to fix your problem?

mohammadhosseinzavvar commented 1 year ago

No dear friend, my dataset and code test = Zigzag1(FrameRatesM5['high'], FrameRatesM5['low'], 12, 5) datetime open high low close tick_volume spread real_volume datetime 2023-03-22 08:20:00 1940.17 1940.96 1940.12 1940.41 301 29 0 2023-03-22 08:20:00 2023-03-22 08:25:00 1940.38 1941.92 1940.31 1941.63 289 29 0 2023-03-22 08:25:00 2023-03-22 08:30:00 1941.6 1941.87 1941.05 1941.64 247 29 0 2023-03-22 08:30:00 2023-03-22 08:35:00 1941.7 1943.07 1941.49 1942.82 290 29 0 2023-03-22 08:35:00 2023-03-22 08:40:00 1942.8 1943.42 1942.17 1942.28 318 29 0 2023-03-22 08:40:00 2023-03-22 08:45:00 1942.26 1942.28 1941.04 1941.57 373 29 0 2023-03-22 08:45:00 2023-03-22 08:50:00 1941.57 1942.34 1941.16 1941.59 236 29 0 2023-03-22 08:50:00 2023-03-22 08:55:00 1941.53 1942.45 1941.16 1942.35 224 29 0 2023-03-22 08:55:00 2023-03-22 09:00:00 1942.33 1942.69 1939.77 1939.78 421 24 0 2023-03-22 09:00:00 2023-03-22 09:05:00 1939.79 1940.46 1938.75 1939.5 477 24 0 2023-03-22 09:05:00 2023-03-22 09:10:00 1939.39 1939.9 1937.96 1938.0 456 24 0 2023-03-22 09:10:00 2023-03-22 09:15:00 1938.01 1939.68 1938.01 1939.52 360 24 0 2023-03-22 09:15:00 2023-03-22 09:20:00 1939.49 1939.92 1937.44 1937.55 395 24 0 2023-03-22 09:20:00 2023-03-22 09:25:00 1937.52 1937.81 1934.18 1935.9 563 24 0 2023-03-22 09:25:00 2023-03-22 09:30:00 1935.93 1937.6 1935.6 1937.14 538 24 0 2023-03-22 09:30:00 2023-03-22 09:35:00 1937.1 1939.05 1936.94 1937.52 411 24 0 2023-03-22 09:35:00 2023-03-22 09:40:00 1937.46 1938.77 1937.25 1938.48 444 24 0 2023-03-22 09:40:00 2023-03-22 09:45:00 1938.5 1941.13 1938.22 1939.58 549 24 0 2023-03-22 09:45:00 2023-03-22 09:50:00 1939.77 1940.37 1939.12 1939.95 381 24 0 2023-03-22 09:50:00 2023-03-22 09:55:00 1940.05 1941.15 1939.73 1939.78 317 24 0 2023-03-22 09:55:00 2023-03-22 10:00:00 1939.5 1941.58 1939.5 1940.37 490 24 0 2023-03-22 10:00:00 2023-03-22 10:05:00 1940.3 1942.18 1939.75 1941.3 444 24 0 2023-03-22 10:05:00 2023-03-22 10:10:00 1941.22 1943.52 1940.94 1943.39 406 24 0 2023-03-22 10:10:00 2023-03-22 10:15:00 1943.38 1944.91 1943.03 1944.52 465 24 0 2023-03-22 10:15:00 2023-03-22 10:20:00 1944.52 1944.94 1943.4 1943.53 441 24 0 2023-03-22 10:20:00 2023-03-22 10:25:00 1943.54 1945.04 1943.36 1944.76 352 24 0 2023-03-22 10:25:00 2023-03-22 10:30:00 1944.82 1945.21 1943.45 1943.53 391 24 0 2023-03-22 10:30:00 2023-03-22 10:35:00 1943.55 1944.29 1942.64 1943.07 461 24 0 2023-03-22 10:35:00 2023-03-22 10:40:00 1943.01 1943.44 1940.35 1941.14 558 24 0 2023-03-22 10:40:00 2023-03-22 10:45:00 1941.19 1942.51 1941.17 1941.44 432 24 0 2023-03-22 10:45:00 2023-03-22 10:50:00 1941.56 1942.6 1940.84 1941.78 402 24 0 2023-03-22 10:50:00 2023-03-22 10:55:00 1941.84 1941.95 1940.58 1941.83 330 24 0 2023-03-22 10:55:00 2023-03-22 11:00:00 1941.83 1943.8 1941.83 1942.97 406 24 0 2023-03-22 11:00:00 2023-03-22 11:05:00 1942.97 1943.4 1942.28 1942.83 354 24 0 2023-03-22 11:05:00 2023-03-22 11:10:00 1942.79 1944.47 1942.47 1944.47 260 24 0 2023-03-22 11:10:00 2023-03-22 11:15:00 1944.51 1944.7 1943.39 1944.16 287 24 0 2023-03-22 11:15:00 2023-03-22 11:20:00 1944.08 1944.63 1943.1 1943.22 325 24 0 2023-03-22 11:20:00 2023-03-22 11:25:00 1943.2 1943.82 1942.61 1943.03 276 24 0 2023-03-22 11:25:00 2023-03-22 11:30:00 1943.1 1944.82 1942.79 1944.81 354 24 0 2023-03-22 11:30:00 2023-03-22 11:35:00 1944.8 1945.57 1943.06 1943.66 422 24 0 2023-03-22 11:35:00 2023-03-22 11:40:00 1943.7 1945.38 1943.6 1944.97 355 24 0 2023-03-22 11:40:00 2023-03-22 11:45:00 1944.98 1945.47 1944.65 1945.4 370 24 0 2023-03-22 11:45:00 2023-03-22 11:50:00 1945.39 1945.41 1944.3 1944.87 409 24 0 2023-03-22 11:50:00 2023-03-22 11:55:00 1944.82 1945.27 1943.8 1943.98 405 24 0 2023-03-22 11:55:00 2023-03-22 12:00:00 1943.97 1945.24 1943.88 1944.84 356 24 0 2023-03-22 12:00:00 2023-03-22 12:05:00 1944.84 1945.18 1943.87 1943.9 273 24 0 2023-03-22 12:05:00 2023-03-22 12:10:00 1943.9 1944.44 1943.31 1944.21 309 24 0 2023-03-22 12:10:00 2023-03-22 12:15:00 1944.26 1945.2 1943.78 1943.94 378 24 0 2023-03-22 12:15:00 2023-03-22 12:20:00 1944.0 1944.57 1943.52 1944.14 343 24 0 2023-03-22 12:20:00 2023-03-22 12:25:00 1944.14 1944.66 1943.8 1943.91 365 24 0 2023-03-22 12:25:00 2023-03-22 12:30:00 1943.68 1943.95 1942.08 1942.23 385 24 0 2023-03-22 12:30:00 2023-03-22 12:35:00 1942.25 1942.7 1941.54 1941.78 296 24 0 2023-03-22 12:35:00 2023-03-22 12:40:00 1941.74 1942.1 1940.41 1940.66 374 24 0 2023-03-22 12:40:00 2023-03-22 12:45:00 1940.63 1942.21 1940.17 1940.78 401 24 0 2023-03-22 12:45:00 2023-03-22 12:50:00 1940.82 1943.7 1940.6 1942.86 338 24 0 2023-03-22 12:50:00 2023-03-22 12:55:00 1942.85 1943.13 1942.05 1942.6 397 24 0 2023-03-22 12:55:00 2023-03-22 13:00:00 1942.61 1942.77 1940.71 1942.56 385 24 0 2023-03-22 13:00:00 2023-03-22 13:05:00 1942.6 1942.6 1941.75 1941.85 413 24 0 2023-03-22 13:05:00 2023-03-22 13:10:00 1941.81 1943.44 1941.73 1942.63 392 24 0 2023-03-22 13:10:00 2023-03-22 13:15:00 1942.63 1943.07 1941.49 1941.67 402 24 0 2023-03-22 13:15:00 2023-03-22 13:20:00 1941.71 1941.85 1940.15 1941.02 464 24 0 2023-03-22 13:20:00 2023-03-22 13:25:00 1941.01 1942.49 1940.83 1942.07 386 24 0 2023-03-22 13:25:00 2023-03-22 13:30:00 1942.09 1942.69 1940.55 1940.91 416 24 0 2023-03-22 13:30:00 2023-03-22 13:35:00 1940.84 1941.55 1940.49 1941.24 356 24 0 2023-03-22 13:35:00 2023-03-22 13:40:00 1941.23 1941.69 1939.7 1940.43 423 24 0 2023-03-22 13:40:00 2023-03-22 13:45:00 1940.42 1941.58 1940.26 1941.48 359 24 0 2023-03-22 13:45:00 2023-03-22 13:50:00 1941.5 1942.26 1941.33 1941.98 336 24 0 2023-03-22 13:50:00 2023-03-22 13:55:00 1942.05 1943.23 1942.05 1942.35 434 24 0 2023-03-22 13:55:00 2023-03-22 14:00:00 1942.37 1943.29 1941.87 1942.66 483 24 0 2023-03-22 14:00:00 2023-03-22 14:05:00 1942.65 1943.4 1940.4 1940.98 441 24 0 2023-03-22 14:05:00 2023-03-22 14:10:00 1940.95 1941.9 1939.65 1941.84 535 24 0 2023-03-22 14:10:00 2023-03-22 14:15:00 1941.89 1942.26 1941.08 1941.87 515 24 0 2023-03-22 14:15:00 2023-03-22 14:20:00 1941.85 1942.88 1940.33 1940.77 646 24 0 2023-03-22 14:20:00 2023-03-22 14:25:00 1940.78 1941.8 1940.72 1941.39 520 24 0 2023-03-22 14:25:00 2023-03-22 14:30:00 1941.37 1941.67 1939.32 1940.35 548 24 0 2023-03-22 14:30:00 2023-03-22 14:35:00 1940.35 1940.38 1938.37 1939.22 526 24 0 2023-03-22 14:35:00 2023-03-22 14:40:00 1939.26 1939.56 1937.86 1939.46 593 24 0 2023-03-22 14:40:00 2023-03-22 14:45:00 1939.43 1939.75 1938.56 1939.49 464 24 0 2023-03-22 14:45:00 2023-03-22 14:50:00 1939.41 1939.99 1938.17 1938.26 478 24 0 2023-03-22 14:50:00 2023-03-22 14:55:00 1938.35 1938.96 1937.01 1937.41 469 24 0 2023-03-22 14:55:00 2023-03-22 15:00:00 1937.37 1940.09 1937.3 1939.75 651 24 0 2023-03-22 15:00:00 2023-03-22 15:05:00 1939.71 1940.65 1939.0 1939.8 523 24 0 2023-03-22 15:05:00 2023-03-22 15:10:00 1939.81 1939.96 1938.04 1939.37 543 24 0 2023-03-22 15:10:00 2023-03-22 15:15:00 1939.36 1940.21 1938.58 1939.8 447 24 0 2023-03-22 15:15:00 2023-03-22 15:20:00 1939.79 1940.19 1939.25 1939.9 419 24 0 2023-03-22 15:20:00 2023-03-22 15:25:00 1939.94 1940.98 1939.92 1940.8 498 24 0 2023-03-22 15:25:00 2023-03-22 15:30:00 1940.77 1943.22 1940.33 1943.02 737 24 0 2023-03-22 15:30:00 2023-03-22 15:35:00 1942.98 1944.32 1942.35 1942.46 693 24 0 2023-03-22 15:35:00 2023-03-22 15:40:00 1942.43 1943.26 1940.84 1941.21 738 24 0 2023-03-22 15:40:00 2023-03-22 15:45:00 1941.06 1942.4 1939.74 1941.42 759 24 0 2023-03-22 15:45:00 2023-03-22 15:50:00 1941.27 1941.8 1940.46 1941.4 561 24 0 2023-03-22 15:50:00 2023-03-22 15:55:00 1941.4 1942.83 1939.31 1942.83 620 24 0 2023-03-22 15:55:00 2023-03-22 16:00:00 1942.83 1944.0 1942.55 1943.67 614 24 0 2023-03-22 16:00:00 2023-03-22 16:05:00 1943.69 1944.3 1942.64 1943.71 669 24 0 2023-03-22 16:05:00 2023-03-22 16:10:00 1943.69 1945.58 1943.35 1945.29 655 24 0 2023-03-22 16:10:00 2023-03-22 16:15:00 1945.28 1945.57 1944.31 1944.87 647 24 0 2023-03-22 16:15:00 2023-03-22 16:20:00 1944.86 1944.91 1943.2 1944.89 571 24 0 2023-03-22 16:20:00 2023-03-22 16:25:00 1944.89 1944.9 1943.5 1944.24 583 24 0 2023-03-22 16:25:00 2023-03-22 16:30:00 1944.26 1944.79 1943.79 1944.34 562 24 0 2023-03-22 16:30:00 2023-03-22 16:35:00 1944.32 1945.31 1943.95 1944.02 558 24 0 2023-03-22 16:35:00 2023-03-22 16:40:00 1944.01 1945.36 1943.27 1944.91 580 24 0 2023-03-22 16:40:00 2023-03-22 16:45:00 1944.9 1949.8 1944.59 1949.57 618 24 0 2023-03-22 16:45:00 2023-03-22 16:50:00 1949.47 1950.95 1948.44 1950.86 692 24 0 2023-03-22 16:50:00 2023-03-22 16:55:00 1950.86 1951.5 1949.62 1950.49 623 24 0 2023-03-22 16:55:00 2023-03-22 17:00:00 1950.31 1950.73 1948.57 1949.35 591 24 0 2023-03-22 17:00:00 2023-03-22 17:05:00 1949.12 1950.82 1949.12 1950.46 527 24 0 2023-03-22 17:05:00 2023-03-22 17:10:00 1950.41 1951.8 1949.11 1951.24 571 24 0 2023-03-22 17:10:00 2023-03-22 17:15:00 1951.23 1951.5 1949.28 1949.4 557 24 0 2023-03-22 17:15:00 2023-03-22 17:20:00 1949.35 1949.46 1947.35 1947.68 514 24 0 2023-03-22 17:20:00 2023-03-22 17:25:00 1947.75 1949.15 1947.65 1949.01 462 24 0 2023-03-22 17:25:00 2023-03-22 17:30:00 1948.97 1949.04 1947.19 1947.65 460 24 0 2023-03-22 17:30:00 2023-03-22 17:35:00 1947.62 1948.47 1947.43 1948.23 426 24 0 2023-03-22 17:35:00 2023-03-22 17:40:00 1948.25 1948.87 1947.51 1948.6 480 24 0 2023-03-22 17:40:00 2023-03-22 17:45:00 1948.61 1948.9 1946.98 1947.7 404 24 0 2023-03-22 17:45:00 2023-03-22 17:50:00 1947.75 1947.82 1946.51 1947.51 461 24 0 2023-03-22 17:50:00 2023-03-22 17:55:00 1947.47 1948.3 1946.98 1947.16 516 24 0 2023-03-22 17:55:00 2023-03-22 18:00:00 1947.18 1947.71 1946.82 1947.3 429 24 0 2023-03-22 18:00:00 2023-03-22 18:05:00 1947.3 1947.71 1946.26 1946.27 304 24 0 2023-03-22 18:05:00 2023-03-22 18:10:00 1946.34 1946.7 1945.98 1946.28 394 24 0 2023-03-22 18:10:00 2023-03-22 18:15:00 1946.32 1947.18 1945.56 1945.7 334 24 0 2023-03-22 18:15:00 2023-03-22 18:20:00 1945.7 1947.55 1945.66 1947.5 368 24 0 2023-03-22 18:20:00 2023-03-22 18:25:00 1947.53 1948.5 1947.36 1948.41 295 24 0 2023-03-22 18:25:00 2023-03-22 18:30:00 1948.41 1948.74 1947.95 1948.27 244 24 0 2023-03-22 18:30:00 2023-03-22 18:35:00 1948.21 1949.39 1948.21 1948.68 336 24 0 2023-03-22 18:35:00 2023-03-22 18:40:00 1948.69 1948.81 1947.82 1948.55 294 24 0 2023-03-22 18:40:00 2023-03-22 18:45:00 1948.54 1949.07 1948.43 1949.07 331 24 0 2023-03-22 18:45:00 2023-03-22 18:50:00 1949.09 1949.48 1948.29 1948.38 401 24 0 2023-03-22 18:50:00 2023-03-22 18:55:00 1948.37 1949.79 1948.37 1949.0 438 24 0 2023-03-22 18:55:00 2023-03-22 19:00:00 1948.98 1950.71 1948.9 1949.16 494 24 0 2023-03-22 19:00:00 2023-03-22 19:05:00 1949.23 1949.25 1947.15 1947.46 478 24 0 2023-03-22 19:05:00 2023-03-22 19:10:00 1947.5 1947.66 1945.84 1946.18 415 24 0 2023-03-22 19:10:00 2023-03-22 19:15:00 1946.2 1946.6 1945.54 1945.56 444 24 0 2023-03-22 19:15:00 2023-03-22 19:20:00 1945.54 1946.9 1945.44 1946.04 372 24 0 2023-03-22 19:20:00 2023-03-22 19:25:00 1945.9 1946.35 1945.14 1946.21 461 24 0 2023-03-22 19:25:00 2023-03-22 19:30:00 1946.13 1948.48 1946.13 1948.45 405 24 0 2023-03-22 19:30:00 2023-03-22 19:35:00 1948.48 1949.28 1948.08 1948.33 340 24 0 2023-03-22 19:35:00 2023-03-22 19:40:00 1948.26 1948.93 1947.86 1948.91 378 24 0 2023-03-22 19:40:00 2023-03-22 19:45:00 1948.93 1949.37 1948.1 1948.65 393 24 0 2023-03-22 19:45:00 2023-03-22 19:50:00 1948.67 1949.08 1946.08 1946.57 417 24 0 2023-03-22 19:50:00 2023-03-22 19:55:00 1946.55 1947.28 1944.91 1945.94 422 24 0 2023-03-22 19:55:00 2023-03-22 20:00:00 1946.07 1966.28 1946.07 1963.43 898 24 0 2023-03-22 20:00:00 2023-03-22 20:05:00 1963.47 1964.36 1955.57 1956.77 786 24 0 2023-03-22 20:05:00 2023-03-22 20:10:00 1956.79 1959.33 1952.42 1953.2 812 24 0 2023-03-22 20:10:00 2023-03-22 20:15:00 1953.18 1959.64 1953.1 1959.6 748 24 0 2023-03-22 20:15:00 2023-03-22 20:20:00 1959.55 1959.57 1956.91 1957.81 724 24 0 2023-03-22 20:20:00 2023-03-22 20:25:00 1957.88 1960.72 1957.79 1959.81 652 24 0 2023-03-22 20:25:00 2023-03-22 20:30:00 1959.9 1960.28 1955.0 1957.32 723 24 0 2023-03-22 20:30:00 2023-03-22 20:35:00 1957.35 1968.29 1956.79 1966.25 825 24 0 2023-03-22 20:35:00 2023-03-22 20:40:00 1966.54 1975.73 1966.52 1973.1 881 24 0 2023-03-22 20:40:00 2023-03-22 20:45:00 1973.21 1976.48 1971.39 1974.68 845 24 0 2023-03-22 20:45:00 2023-03-22 20:50:00 1974.84 1978.67 1972.74 1973.65 810 24 0 2023-03-22 20:50:00 2023-03-22 20:55:00 1973.46 1973.49 1968.63 1970.79 1005 24 0 2023-03-22 20:55:00 2023-03-22 21:00:00 1970.76 1970.82 1957.25 1957.25 981 24 0 2023-03-22 21:00:00 2023-03-22 21:05:00 1957.34 1963.13 1954.11 1956.71 1008 24 0 2023-03-22 21:05:00 2023-03-22 21:10:00 1956.86 1965.71 1956.18 1963.96 1008 24 0 2023-03-22 21:10:00 2023-03-22 21:15:00 1963.92 1965.1 1960.71 1963.6 809 24 0 2023-03-22 21:15:00 2023-03-22 21:20:00 1963.71 1965.05 1961.68 1963.9 793 24 0 2023-03-22 21:20:00 2023-03-22 21:25:00 1964.11 1969.2 1963.85 1967.91 813 24 0 2023-03-22 21:25:00 2023-03-22 21:30:00 1967.91 1968.52 1963.82 1965.4 746 24 0 2023-03-22 21:30:00 2023-03-22 21:35:00 1965.35 1966.19 1963.34 1965.26 671 24 0 2023-03-22 21:35:00 2023-03-22 21:40:00 1965.16 1968.28 1964.94 1966.0 639 24 0 2023-03-22 21:40:00 2023-03-22 21:45:00 1966.01 1968.22 1964.99 1967.79 675 24 0 2023-03-22 21:45:00 2023-03-22 21:50:00 1967.8 1975.08 1967.44 1973.25 748 24 0 2023-03-22 21:50:00 2023-03-22 21:55:00 1973.28 1975.2 1971.72 1972.61 713 24 0 2023-03-22 21:55:00 2023-03-22 22:00:00 1972.61 1975.03 1970.66 1973.77 449 24 0 2023-03-22 22:00:00 2023-03-22 22:05:00 1973.72 1973.72 1972.11 1972.45 327 24 0 2023-03-22 22:05:00 2023-03-22 22:10:00 1972.5 1973.14 1969.58 1969.85 361 24 0 2023-03-22 22:10:00 2023-03-22 22:15:00 1969.73 1969.92 1968.25 1968.77 212 24 0 2023-03-22 22:15:00 2023-03-22 22:20:00 1968.73 1968.99 1967.56 1967.85 268 24 0 2023-03-22 22:20:00 2023-03-22 22:25:00 1967.89 1968.21 1967.5 1968.04 202 24 0 2023-03-22 22:25:00 2023-03-22 22:30:00 1968.04 1968.13 1966.88 1966.92 175 24 0 2023-03-22 22:30:00 2023-03-22 22:35:00 1966.91 1967.91 1966.9 1967.48 188 27 0 2023-03-22 22:35:00 2023-03-22 22:40:00 1967.53 1967.72 1966.75 1967.55 144 30 0 2023-03-22 22:40:00 2023-03-22 22:45:00 1967.53 1967.72 1966.84 1967.13 192 31 0 2023-03-22 22:45:00 2023-03-22 22:50:00 1967.14 1968.18 1966.84 1967.98 220 25 0 2023-03-22 22:50:00 2023-03-22 22:55:00 1967.95 1969.98 1967.9 1969.63 200 29 0 2023-03-22 22:55:00 2023-03-23 00:00:00 1969.89 1970.62 1967.58 1967.65 209 29 0 2023-03-23 00:00:00 2023-03-23 00:05:00 1967.65 1967.79 1965.01 1965.34 219 24 0 2023-03-23 00:05:00 2023-03-23 00:10:00 1965.38 1966.39 1965.38 1965.77 148 24 0 2023-03-23 00:10:00 2023-03-23 00:15:00 1965.77 1966.69 1964.46 1966.57 151 24 0 2023-03-23 00:15:00 2023-03-23 00:20:00 1966.49 1966.77 1965.8 1966.19 117 24 0 2023-03-23 00:20:00 2023-03-23 00:25:00 1966.19 1966.77 1965.51 1966.77 139 24 0 2023-03-23 00:25:00 2023-03-23 00:30:00 1966.77 1967.7 1966.38 1967.12 150 24 0 2023-03-23 00:30:00 2023-03-23 00:35:00 1967.12 1968.18 1967.12 1967.6 126 24 0 2023-03-23 00:35:00 2023-03-23 00:40:00 1967.58 1967.89 1966.05 1966.42 138 24 0 2023-03-23 00:40:00 2023-03-23 00:45:00 1966.36 1967.1 1965.94 1966.53 127 24 0 2023-03-23 00:45:00 2023-03-23 00:50:00 1966.51 1967.07 1965.89 1966.12 140 27 0 2023-03-23 00:50:00 2023-03-23 00:55:00 1966.12 1966.74 1965.37 1965.43 138 29 0 2023-03-23 00:55:00 2023-03-23 01:00:00 1965.44 1967.09 1965.44 1966.85 183 24 0 2023-03-23 01:00:00 2023-03-23 01:05:00 1966.85 1967.47 1966.41 1966.56 141 24 0 2023-03-23 01:05:00 2023-03-23 01:10:00 1966.53 1966.91 1966.09 1966.53 143 24 0 2023-03-23 01:10:00 2023-03-23 01:15:00 1966.56 1968.3 1966.56 1967.56 209 24 0 2023-03-23 01:15:00 2023-03-23 01:20:00 1967.6 1968.05 1967.37 1967.8 112 24 0 2023-03-23 01:20:00 2023-03-23 01:25:00 1967.8 1967.82 1967.32 1967.4 147 24 0 2023-03-23 01:25:00 2023-03-23 01:30:00 1967.4 1967.4 1966.19 1966.71 197 24 0 2023-03-23 01:30:00 2023-03-23 01:35:00 1966.69 1968.38 1966.69 1968.37 125 25 0 2023-03-23 01:35:00 2023-03-23 01:40:00 1968.37 1968.37 1967.68 1967.98 107 22 0 2023-03-23 01:40:00 2023-03-23 01:45:00 1967.95 1970.09 1967.77 1969.83 238 24 0 2023-03-23 01:45:00 2023-03-23 01:50:00 1969.56 1969.56 1968.65 1968.97 199 24 0 2023-03-23 01:50:00 2023-03-23 01:55:00 1969.0 1969.59 1968.92 1969.49 64 24 0 2023-03-23 01:55:00

DaveSkender commented 1 year ago

Just doing a quick visual scan of prices, it wouldn’t produce more than ~2% change, so your threshold of 5% would never be met. Change your percent_change threshold value to 0.5 or 1 to see if that produces values. Also check to see if your wrapper Zizag1 function is sending in the full quote data, including close price.

mohammadhosseinzavvar commented 1 year ago

My problem is that it is not like Trading View and it shows small peaks and valleys

DaveSkender commented 1 year ago

I don’t think TradingView will pivot any better on this data, but I do understand the frequency of pivots issue and we plan to look at that in this issue https://github.com/DaveSkender/Stock.Indicators/issues/694, but that’s a separate problem describing above.

It sounds like we address the original concern here, so closing this one. Please submit a new issue if it’s different from the one mentioned here.