Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modify NBarsDown

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

    Modify NBarsDown

    Looking to modify NbarsDown.

    Currently the value is a Bar- but i am looking to make it a support line that I can use in a strategy.

    It reads:
    Value.Set(gotBars == true ? 1 : 0);

    I can change the return to return the first bar Open


    Value.Set(gotBars == true ? High[3] : 0);

    However I dont know of a way to re-code the indicator to remove the 0. AKA dont need IF true High[3], else 0. I need if true, High[3].


    Is there a simple way to to do this?

    I would love it to eventually look like this :

    World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


    TIA

    ***EDIT:

    Got close using this

    World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.
    Last edited by wprosser; 10-14-2011, 08:47 AM.

    #2
    Hi wprosser,

    It sounds like you want an if statement here.

    if (gotBars)
    Value.Set(High[3]);
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thank your very much- just figured that out.

      World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


      Is there a way to extend the dot by 5 more bars? and only 5 bars?

      TIA

      Comment


        #4
        Unfortunately not a simple change I could think of that would extend the dots by 5 bars. You would likely need to make some changes to that for loop or start over and build the expression from scratch based on what you want to see.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Cool beans. Thanks for your help.

          maybe use a CrossAbove with an offsetting look back in my strategy code.....

          Thanks again Ryan for your timely response

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          574 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          333 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X