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/
-
1:36:16
PMG
1 day ago $0.07 earnedSPECIAL: JUSTICE FOR JEREMY - NOW!
5.95K1 -
1:01:01
TheTapeLibrary
12 hours ago $1.17 earnedThe Horrifying True Story of Summerwind Mansion
20.9K2 -
29:28
Afshin Rattansi's Going Underground
1 day agoMax Blumenthal on US’ Ukraine Aid Corruption, 'Psychotic' Israel Turning the West Bank into Gaza
30.4K4 -
57:12
Flyover Conservatives
21 hours agoCovid, Control, & Corruption —Dr. Stella Immanuel’s Plan to BEAT the System! | FOC Show
17.9K -
57:13
Sarah Westall
5 hours agoUnited States in a Two Front War, Identify Military Psyops and Special Operations w/ Jeffrey Prather
58.7K7 -
2:14:05
Quite Frankly
9 hours ago"Open Phones: Philly & D.C. Crashes" 1/31/25
44.1K11 -
1:45:32
2 MIKES LIVE
8 hours ago2 MIKES LIVE #173 Open Mike Friday!
46.1K1 -
54:53
LFA TV
11 hours agoDemocrats’ Greatest Fear Is Accountability | TRUMPET DAILY 1.31.25 7pm
34.9K16 -
23:15
Bare Knuckle Fighting Championship
1 day agoBKFC FIGHT NIGHT MOHEGAN SUN FREE FIGHTS
32K2 -
5:49:46
Bitfinex
11 hours agoBitfinex Talks Live at PlanB El Salvador - Day 2
33.9K2