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

Draw Line Between Two Time Events

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

    Draw Line Between Two Time Events

    Dear Support,

    I am looking for a sample script to Draw.Line between two events:

    Start: Close of the Friday (or close of the trading week)

    and continues to:

    End: Close of the following Friday (or close of the following trading week)

    Should be able to use the script on any time frame.

    Many thanks.

    #2
    Helloaligator,

    I am not aware of an existing indicator that draws a line from friday to friday and this may need to be custom created.

    This thread will remain open for any community members that are aware of a script that accomplishes this.


    You could create this script by writing logic that identifies a day as friday and begins drawing a line.

    As a suggestion, you could use a condition that on friday will draw the line one last time for the previous week using the old tag name and will create a new tag name and draw a new line for the current week.

    I would recommend saving the date of the previous friday to use as the StartTime for the line and then use the current bar's time as the end of the bar.

    If the current day is not friday, are you wanting no line drawn? Are you wanting a line to the current bar?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Helloaligator,

      I am not aware of an existing indicator that draws a line from friday to friday and this may need to be custom created.

      This thread will remain open for any community members that are aware of a script that accomplishes this.


      You could create this script by writing logic that identifies a day as friday and begins drawing a line.

      As a suggestion, you could use a condition that on friday will draw the line one last time for the previous week using the old tag name and will create a new tag name and draw a new line for the current week.

      I would recommend saving the date of the previous friday to use as the StartTime for the line and then use the current bar's time as the end of the bar.

      If the current day is not friday, are you wanting no line drawn? Are you wanting a line to the current bar?
      Thanks ChelseaB,

      All I really want to do is to draw and show the close of the last trading week during the current trading week. My issue is using proper time anchors for draw statement.

      Perhaps I can use or modify the PriorWeekOHLC indicator.

      Chers!

      Comment


        #4
        Hello aligator,

        Are you saving the close time of the last friday to a DateTime variable and using this for the StartDate?

        If not, what code are you currently using to try and achieve this?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by funk10101, Today, 09:43 PM
        0 responses
        6 views
        0 likes
        Last Post funk10101  
        Started by pkefal, 04-11-2024, 07:39 AM
        11 responses
        37 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Yesterday, 08:51 AM
        8 responses
        44 views
        0 likes
        Last Post bill2023  
        Started by yertle, Today, 08:38 AM
        6 responses
        26 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Started by algospoke, Yesterday, 06:40 PM
        2 responses
        24 views
        0 likes
        Last Post algospoke  
        Working...
        X