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 cmoran13, 04-16-2026, 01:02 PM
        0 responses
        51 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        31 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        165 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        100 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        160 views
        2 likes
        Last Post CaptainJack  
        Working...
        X