• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to use Current Bar last price

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

    How to use Current Bar last price


    https://gyazo.com/4a8a07b18b9b63cbf7b5d81bef5c78f7

    i do not see Last as a choice here

    ideally i am trying to say current price last print etc <= Open[1]

    but do not see a way to do this

    if i use Low[0] <= Open[1] using after hours historical data chart to review i get my execution but it fills on the next bar Open price rather that the previous bar when the condition occurred

    any help appreciated thanks

    #2
    last = Close[0]

    Comment


      #3
      thanks but it certainly does not work that way viewing historical data after hours

      Comment


        #4
        Hello DTSSTS,

        Thanks for your post.

        As member nkhoi advises, Close[0] is last price.

        When running a strategy on historical data, the strategy will execute once at the end of the bar, if your code at the end of the bar places an order it would be filled on the next bar.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          so it would be filled on the next bar in historical data, WHAT about realtime data, If the low of the previous bar is lower the the low of the reference bar to send the order will Close[0] <= Low[2] fill in real time on the CURRENT bar at the time the reference price was printed rather than the NEXT BAR

          Comment


            #6
            Hello DTSSTS,

            Thanks for your reply.

            What calculate mode are you using in the strategy? (OnBarClose, OnPriceChange, OnEachTick)
            What type order are you placing? (Limit or Market)
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              on price change and SellStopMarket

              Comment


                #8
                Hello DTSSTS,

                Thanks for your reply.

                With your strategy running Calculate.OnPriceChange, the order would be placed intrabar when the code conditions are executed (instead of only at the end of the bar on historical data).



                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Austiner87, Today, 08:16 AM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_ChrisL  
                Started by 7robert, Today, 07:27 AM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_PatrickG  
                Started by GLFX005, Today, 07:18 AM
                2 responses
                6 views
                0 likes
                Last Post GLFX005
                by GLFX005
                 
                Started by Erhard, Today, 04:24 AM
                5 responses
                25 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by brunoviveiros, Today, 04:26 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X