Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar range for 1:1 targets

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

    Bar range for 1:1 targets

    Is there an indicator or a way of taking the previous bar range (high to low) and add it to the top and bottom of the previous bar. This would essential provide 1:1 target above the previous bar and a 1:1 target below the bar.

    For example:

    The previous bar just finished printing and was 5 points (top to bottom). I would like to project a horizontal line 5 points above the previous bar and 5 points below the previous bar.

    I do not know how to code, so I am hoping there is an indicator that exists.



    #2
    Hello PsycTrader1,

    Welcome to the NinjaTrader forums!

    if (CurrentBar < 1)
    return;

    Print( (High[1] - Low[0]) + High[0]);
    Print( (High[1] - Low[0]) + Low[0]);

    This is simple enough you could create this with the Strategy Builder to avoid hand programming.

    Below is a link to a forum post with helpful resources on getting started with NinjaScript and C# and includes a link to the 'Automate Your Trading with NinjaTrader's Strategy Builder' training video.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea.

      So all I have to do is copy and paste what you provided into the "Strategy Builder" and it should work?

      Also, this "Strategy Builder" is an indicator? I am not looking for automated trading; I am looking for an indicator that prints two horizontal lines for only the previous bar.

      Thanks,
      Johnathan

      Comment


        #4
        Hello Johnathan,

        The Strategy Builder uses a point and click interface, so you would need to add variables and use offsets with each series to do math and add the values together in the 'Do the following' actions second of the Conditions and Actions section.

        The Strategy Builder creates strategies. However, it can generate logic that can be copied and pasted into an indicator script by clicking the View Code button.

        Please watch the 'Automate Your Trading with NinjaTrader's Strategy Builder​' training video linked in the forum post linked in post # 2.

        Attached is an example.
        Attached Files
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        557 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 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
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X