Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

new strategy

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

    new strategy

    Hi,

    I would like some advice on how do I keep the open and close on the first bar (at session open) so I can use the values elsewhere.

    Thanks,
    Andrew

    #2
    Andrew, you could save them to a custom variable at a new session start - http://www.ninjatrader-support.com/H...sionBreak.html

    Comment


      #3
      Hi,

      I am working on 60min timeframe and I am using the OHLC values in my formula. How do I program in if at the next bar the current price moves above / below the previous bar High / Low then go long / short?

      Thanks,
      Andrew

      Comment


        #4
        Andrew, you could for example use the Strategy Wizard we have and then setup a condition to check if the Close is greater (or crossing above) the previous bar's High value (High[1]).

        Then you can enter your 'action' (EnterLong) in the second ('Do the following') portion of the wizard's main interface -

        Comment


          #5
          Hi,
          thank you for you reply.

          With your previous reply, I am working on the 1H TF, I don't want to enter at the close of the next 1H but during the next hour if the price crosses about the previous 1H bar high then I enter.

          I set up similar to below and it always enters the at the open and not when the price actually crosses over within the 1h bar.

          Thanks,
          Andrew

          Comment


            #6
            Hello Andrew100,



            Running a Strategy at the Close of a Bar or Tick by Tick
            • During backtest, strategies can ONLY be processed at the close of each bar.
            • During real-time operation, you have a choice to run a strategy tick by tick or on bar close. This can produce different results because you can have a signal that executes an order when running tick by tick, although the signal can be false at the close of the same bar.
            You can change a setting to have this work differently in a real-time environment. You can set CalculateOnBarClose to false for tic by tic updating. Your order is submitted whenever conditions evaluate to true.


            More information on why backtesting works differently than real-time is found at the link below:
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            648 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            573 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            575 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X