Premium Only Content

Tutorial 210 | Make a horizontal line 'snap' to pivots
Tutorial 210 demonstrates some techniques that enable a horizontal line to be moved up and down on the chart and to 'snap' to the nearest high pivot. The pivots have been calculated and displayed on the visible window by this program.
To achieve this the program ascertains the start date and time and end date and time of the visible window. It looks for pivots on this part of the chart and stores them in a vector. It then sorts the vector. In addition the initial position of the horizontal line is set to the center price.
The horizontal line moving event updates a variable with the current price of the line. When the user releases his mouse the chart element click event of the charting host fires. The price of the line is then compared with the values in the vector of pivots to ascertain which is the closest. The price of the line is then set to this value.
N.B As the chart develops and new pivots are added, the vector is updated, however pivots that were to the left of the chart and are now no longer visible are left in the vector. This can result in the line being adjusted to a pivot level that is no longer visible. If the window is changed the user will need to turn off and on the program so that it recalculates the pivots for the current window.
See https://markplex.com/free-tutorials/tutorial-210-make-a-horizontal-line-snap-to-pivots/
-
LIVE
The Mel K Show
56 minutes agoMORNINGS WITH MEL K -Overwhelming Evidence of Grand Conspiracy Against We the People 10-7-25
802 watching -
LIVE
The Shannon Joy Show
11 hours agoEugenics, Vaccination & The Unholy Trump/Pfizer Alliance LIVE W/ Brook Jackson & Warner Mendenhall
275 watching -
31:12
Grant Stinchfield
1 hour agoWhen Science Became Propaganda
3.9K4 -
LIVE
Trumpet Daily
1 hour agoTrumpet Daily LIVE | Oct. 7, 2025
282 watching -
1:00:59
VINCE
4 hours agoWho Else Were They Spying On? | Episode 141 - 10/07/25
189K131 -
1:46:37
Dear America
4 hours agoBIDEN FBI CAUGHT SPYING!! Jack Smith Tracked Calls of DOZENS Of Senators!! JAIL NOW!!
95.4K46 -
2:14:00
Badlands Media
8 hours agoBadlands Daily: October 7, 2025
40.1K13 -
1:10:50
The Big Migâ„¢
3 hours agoConfirmed, Foreign Power Interfered in U.S. Election
15K8 -
DVR
The State of Freedom
6 hours ago $0.12 earned#339 Local Justice & A National Awakening
8.15K1 -
25:19
Rethinking the Dollar
2 hours agoTrump's Alaska Mining Deal Just Made The Stock Explode | Morning News Update
25.2K6