Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limiting plot values

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

    Limiting plot values

    Hi
    I have read through the earlier post as I want to set a max value for a plot. Hope you can help as the suggestions made did not work and it is because I am working with time.

    I have written a simple code to time a volume bar relative to previous bars and then color it accordingly. This shows me whether the volume is accelerating or not. I want to limit the plot value of each bar to a max of 120 secs regardless of the actual time value.
    I want to do this as the first bar on Sunday pm is 179,100 secs (fri close to sunday pm open)
    and the average is about 70 secs during trading hours so the 70 gets lost from the graph once the bar is plotted. Same problem over night as well.

    Obviously I cant have anything less or more than 86,400 secs in a day but I was hoping to be able to terminate the plot (not the value) at 120 secs per bar.

    Any ideas?

    Code:
    TimeSpan timer = Time[0] - Time[1];
    Value.Set(timer.TotalSeconds);

    Thanks;

    Ben.

    #2
    Hello Ben,
    Thanks for writing in and I am happy to assist you.

    You can use the Math.Min method to set a value.
    Like
    Code:
    Value.Set(Math.Min(timer.TotalSeconds, 120));
    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Perfect thankyou.

      Comment


        #4
        Hello Ben,
        Glad you could resolve the issue.

        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pilotfo, Today, 12:50 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by DTSSTS, Today, 11:35 AM
        2 responses
        10 views
        0 likes
        Last Post DTSSTS
        by DTSSTS
         
        Started by sinpeople, Today, 07:20 AM
        2 responses
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Frank1000, Today, 03:05 AM
        5 responses
        15 views
        0 likes
        Last Post Frank1000  
        Started by fscabrera03, Yesterday, 01:18 PM
        2 responses
        25 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X