Announcement

Collapse
No announcement yet.

Pivot Point History

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pivot Point History

    I was looking for a way to only have the current days pivots displayed. I found a way to do this a while back, but after a couple days of searching for it, no luck. It was something not to difficult. I remember is was that you had to add a couple lines in the preMain() and a line or two in the Main(). I also found the way to remove the "ramps" from the previous day to the current day, but that didnt do what I'm looking for. Any ways, any help with this would be appreciated.



    Thanks
    -Nick
    " If a man didn't make mistakes he'd own the world in a month. But if he didn't profit from his mistakes, he wouldn't own a blessed thing."
    -Jesse Livermore

  • #2
    Hello Nick,

    To prevent the pivots from plotting on the historical days, you need to compare the date of the bars to the system date using the corresponding date object for each. Check for the first bar in the chart that has a date that matches today’s current date, then allow the rest of the formula to compute. Here's a code example of how to do this. Add this to the top of your main() function.


    PHP Code:
    var bToday false;

    function 
    main() {
        if (
    getBarState() == BARSTATE_ALLBARS) {
            
    bToday false;
        }
        
        if (
    bToday == false && getDay(0) != getDay(-1)) {
            var 
    vDate = new Date();
            var 
    vBarDate getValue("time");
            if (
    vDate.getDate() == vBarDate.getDate() && vDate.getMonth() == vBarDate.getMonth()) {
                
    bToday true;
            }
        }
        if (
    bToday == false) return;

        ....
        .... 
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Jason,
      Thats exactly what I was looking for. I appreciate all of the help!


      -Nick
      " If a man didn't make mistakes he'd own the world in a month. But if he didn't profit from his mistakes, he wouldn't own a blessed thing."
      -Jesse Livermore

      Comment

      Working...
      X