Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Outside Bar

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

    Outside Bar

    Hi all. I'm looking for something very simple: the ninjascript for an outside bar up(or down) that is triggered intrabar, i.e., low(0) < low(1) and last > high(1).

    Can this be done in the wizard or only by writing the code?

    Will the backtest results calculate from when the high(1) is broken or just on the bar close? I'd like it to trigger and calculate from when the high is broken.

    Thanks!

    #2
    Yes, this can be done via the Wizard for the creation of an automated strategy. In a backtest, you only have OHLC data of the bar, not the data that formed the bar so...in backtest its on close of the bar. You can run it in real-time to trigger intrabar.
    RayNinjaTrader Customer Service

    Comment


      #3
      Thanks for the response. So there is no workaround on getting it to trigger intrabar on the backtest, even using multiple time frames?

      When running live, I don't see a price data option for Last so I can't trigger when:

      Low[0] < Low[1]
      Last crosses above High[1]

      Is it best to use something like Bid crosses above High[1]? If so, will this language also work for backtesting?

      Comment


        #4
        You could do something using multi-time frames for sure. You can check 1 minute time frame to see if the high on a 5 minute time frame is penetrated.

        More information - http://www.ninjatrader-support.com/H...struments.html

        Bid can be used in a backtest but it will refer to the Close internally since there is no historical bid data in a backtest.
        RayNinjaTrader Customer Service

        Comment


          #5
          Hi Guys, Im working on a simalar stategy. In real time on interbar I want it to enter 2 position in the same direction (
          EntriesPerDirection =
          2;
          EntryHandling = EntryHandling.AllEntries but for some reason it doesnt just enter these 2 positions and let it run, it continues to enter and cancel positions intil the price finishes fluctuating around the entry trigger point. Im not sure where to look for a solution, could you please direct me?

          Good luck on the strategy tbone4.

          Comment


            #6
            Not sure I follow, do you want only 2 entries for the entire trading session?
            RayNinjaTrader Customer Service

            Comment


              #7
              Sorry I wasnt clear Ray...Yes only 2 position in one direction until both positions are flat then the stategy can enter new positions from there.

              Comment


                #8
                You would need to self program this by creating some type of counter, then resetting when the position is flat. There are not functions in NinjaScript that will do this for you.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  scaling off a position

                  Ok, I tried changing the entry to a singe position entry of 2 mini lots instead of 2 separate positions. That seems to cure the problem of multiple entry and cancellations I was having previously.

                  Now my question is are there any examples or references on how to make the stategy take profit on half of the position at a certain profit target while letting the balance run? (scale off)

                  Comment


                    #10
                    Off the top of my head I can't remember, check the Educational section of the forum under "Reference Samples"
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      In case you were unable to locate the reference: http://www.ninjatrader-support.com/v...ead.php?t=3751
                      Josh P.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      596 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      343 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      103 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      556 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      554 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X