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/
-
43:37
The Rubin Report
2 hours agoTriggernometry Hosts Try to Hide Their Shock at Sam Harris’ Charlie Kirk Claim
19.5K19 -
LIVE
SOLTEKGG
54 minutes ago🟢 Live: Pro Player Returns to Battlefield 6 RED SEC
65 watching -
LIVE
StevieTLIVE
2 hours agoFriday Warzone HYPE: Come Chill, Chat, and Watch Me Fry
74 watching -
1:00:57
Dr. Eric Berg
3 days agoThe Dr. Berg Show LIVE - November 21, 2025
12.1K9 -
LIVE
Film Threat
18 hours agoWICKED FOR GOOD + SISU 2 + LOADS OF REVIEWS! | Film Threat Livecast
91 watching -
LIVE
The Mel K Show
1 hour agoMORNINGS WITH MEL K - Globalists Continue to Pursue Agenda 2030-While Americans are Being Easily Distracted 11-21-25
758 watching -
1:02:43
VINCE
4 hours agoDid The Democrats Really Just Commit Treason? | Episode 174 - 11/21/25 VINCE
188K172 -
1:01:48
Benny Johnson
3 hours agoHow To Fix The Biggest Crisis In America: Housing | Saving The American Dream for Young People 🇺🇸
44.2K47 -
LIVE
LFA TV
15 hours agoLIVE & BREAKING NEWS! | FRIDAY 11/21/25
1,754 watching -
2:44:29
Matt Kohrs
13 hours agoMarkets Tilted, OPEX Chaos & Payday Friday || Live Trading
28.8K1