Support Board
Date/Time: Thu, 06 Feb 2025 19:50:52 +0000
Post From: ZigZag Volume / Length in Ticks missing fabs
[2020-04-29 15:53:36] |
Yoda - Posts: 106 |
The Volume / Length in Ticks ("V/L") number (ln 36 in the ZigZag study) is reversing the sign on down moves. This happens when you set Volume to Accumulate (Ln 1) to Ask Bid Volume Difference For example, on UP moves: - If the volume to accumulate is positive, the V/L is also positive. - Likewise, if the volume to accumulate is negative, the V/L is also negative. However, on DOWN moves: - if the volume to accumulate is positive, the V/L is negative (it should be positive). - Likewise, if the volume to accumulate is negative, the V/L is positive (it should be negative). Looking at the code, it appears line 1199 in Studies 7.cpp should be taking the absolute of the ZigZagLineLength. I suggest the code should be: int64_t VolumeDividedByLengthInTicks = int64_t(AccumulatedVolume[ZigZagIndex] / fabs(ZigzagLineLength / sc.TickSize)); Date Time Of Last Edit: 2020-04-30 13:13:05
|