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/
-
49:56
X22 Report
4 hours agoMr & Mrs X - [DS] Antifa Are Planning An Insurrection,Trump Has Prepared The Counterinsurgency-EP 11
42.5K45 -
1:08:57
Wendy Bell Radio
8 hours agoPet Talk With The Pet Doc
38.5K26 -
8:47
Demons Row
2 days ago $1.45 earnedI Spent $50,000 Building My Dream Harley-Davidson 😳💀 (Learn From My Mistakes)
37.2K9 -
38:18
SouthernbelleReacts
22 hours ago $1.53 earnedThey Thought the Secret Was Buried… But I’m Screaming! | Reaction to I Know What You Did Last Summer
28.7K1 -
29:37
Midwest Crime
1 day ago5 Cops Shot as Minnesota Raid Turns into Chaos
56.8K163 -
31:08
mizery
17 days ago $0.52 earnedI Asked 100 Pros To Help Me Go Pro...
13.8K2 -
7:03:56
FyrBorne
16 hours ago🔴Battlefield 6 Live M&K Gameplay: A Return to Form for This Former Giant
22.2K -
3:40
Danny Rayes
2 days ago $0.81 earnedInfluencers Are Going Broke. What Happened?
9.52K4 -
11:08
It’s the Final Round
19 hours ago $2.91 earned💰NFL Week 6 Best Bets🔥Player Prop Picks, Parlays, Predictions FREE Today October 12th
22.1K5 -
10:28
nospeedlimitgermany
3 days ago $0.31 earnedMercedes-Benz C 63 AMG *Edition 507* V8 W204 | 507 PS | Top Speed German Autobahn No Speed Limit POV
4.57K5