Tutorial 210 | Make a horizontal line 'snap' to pivots

Поделиться
HTML-код
  • Опубликовано: 10 фев 2025
  • 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 markplex.com/f...

Комментарии • 3

  • @SuccessOverStress
    @SuccessOverStress Месяц назад

    Thanks for the video. I was actually working on something within the last week and couldn't remember how to access the left and right displayed date time.

  • @M19Capital
    @M19Capital Месяц назад

    I wrote you an email long time ago about your coding course, do you still accept new students at 20$ per month?

    • @markplex
      @markplex  Месяц назад

      I don't think I've ever had a program for $20/month, but I do still offer Gold Pass. See markplex.com/markplex-membership/