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

Lines retained on charts

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

    Lines retained on charts

    Hi, I am trying to build a strategy using the builder. It places lines on the chart to correspond with signals from an indicator. As the strategy updates, previous lines are removed from the chart and new lines are drawn.

    Is it possible to get the strategy to leave previous lines on the chart when the strategy updates? As I am not a programmer I need to use the builder.

    Thanks
    Linda1507
    Attached Files

    #2
    Build all the strategy in builder, on the end you have to use ninjascript editor. I recommend to use IsFirstTickOfBar. For Example
    if(IsFirstTickOfBar)
    {
    RemoveDrawObjects();
    }

    The syntax will remove ALL drawn objects.

    Sorry for bad english, but i just want to help

    Watch out because if you use the strategy in editor, you couldn't back to builder

    Comment


      #3
      Hello Linda1507,

      Thanks for your post.

      By default when you select a draw object to draw within the strategy builder, the code is created such that only the "latest" draw object will remain on the chart. Draw objects are identified by using a "tag name". If you use the same tag name the previously drawn object is removed and replaced by the newest draw object with the same tag name. To show all of the draw objects each must have a "unique" tag name.

      I've previously created a short video that covers offsetting markers and how to create unique tag names within the strategy builder, please see: https://paul-ninjatrader.tinytake.co...A4M184NTkwOTg3
      Last edited by NinjaTrader_PaulH; 10-23-2018, 06:13 AM. Reason: Clarified that the video relates to strategy builder.
      Paul H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by terofs, Today, 04:18 PM
      0 responses
      0 views
      0 likes
      Last Post terofs
      by terofs
       
      Started by nandhumca, Today, 03:41 PM
      0 responses
      4 views
      0 likes
      Last Post nandhumca  
      Started by The_Sec, Today, 03:37 PM
      0 responses
      3 views
      0 likes
      Last Post The_Sec
      by The_Sec
       
      Started by GwFutures1988, Today, 02:48 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by ScottWalsh, 04-16-2024, 04:29 PM
      6 responses
      33 views
      0 likes
      Last Post ScottWalsh  
      Working...
      X