Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Plot to connect first bar of each session with the first bar of next session.........

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

    Plot to connect first bar of each session with the first bar of next session.........

    Hi Folks,

    I would like to plot the following:


    - a line plot connecting the OPEN of mondays first bar to OPEN of tuesdays first bar and then to OPEN of wednesdays first bar and so on

    - a line plot connecting the CLOSE of mondays first bar to CLOSE of tuesdays first bar and then to CLOSE of wednesdays first bar and so on

    - Then color the region between this OPEN and CLOSE plots

    - Repeat this for all subsequent bars: for example...a plot connecting all the second bar opens and second bar closes....then third bar and so on......and then color each bar plot region a different color......first one green, second pink, third blue and so on..............

    Any help would be greatly appreciated.........

    Thank you.
    Zoomer

    #2
    You could use Bars.FirstBarOfSession for the first bar but for subsequent you would need to come up with a way to track the number of bars per session and then use that distance to set the plot values.

    Are you planning to run this on the same session/time frame each time, or can it be dynamic?
    LanceNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Lance View Post
      You could use Bars.FirstBarOfSession for the first bar but for subsequent you would need to come up with a way to track the number of bars per session and then use that distance to set the plot values.

      Are you planning to run this on the same session/time frame each time, or can it be dynamic?
      Thank you for the reply....i was planning to use it on diffrent timeframes...........

      Comment


        #4
        In this case you won't be able to do it with plots, as you would have a different number of plots each time you ran the script. Instead you would likely need to do something with DrawLine(). Your start bar would be based on the time frame (you would have to create an algorithm to check this to determine how many bars ago) and your end bar would be the current bar of 0.



        Downside with this is that could be a very large number of drawing objects which could cause a performance hit.

        Let me know if I can further assist
        LanceNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Lance View Post
          In this case you won't be able to do it with plots, as you would have a different number of plots each time you ran the script. Instead you would likely need to do something with DrawLine(). Your start bar would be based on the time frame (you would have to create an algorithm to check this to determine how many bars ago) and your end bar would be the current bar of 0.



          Downside with this is that could be a very large number of drawing objects which could cause a performance hit.

          Let me know if I can further assist
          Thank you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,611 views
          0 likes
          Last Post aligator  
          Started by jaybedreamin, Today, 05:56 PM
          0 responses
          9 views
          0 likes
          Last Post jaybedreamin  
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          19 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          6 views
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          22 views
          0 likes
          Last Post Javierw.ok  
          Working...
          X