Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Detecting the Last Trade price

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

    Detecting the Last Trade price

    I am trying to create an indicator that will plot a hash mark when price of the current bar is greater than or equal to the previous bar's high. I didn't see a DataSeries for the last trade value. So can someone help me translate the following pseudo-code. Thanks for any help given.

    Pseudo-Code:

    if (Last Price of the current bar > High[1] /* High of the previous bar */)
    then
    EntryHash.Set(Last Price of current bar);
    endif

    Thanks Again for any help

    #2
    Hello Rcheezem,

    Thank you for your note.

    You would use the Close[0] for the last price of the current bar

    Code:
    if(Close[0] > High[1])
    {
         EntryHash.Set(Close[0]);
    }
    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Cal. But I was wondering about the values between the close and the high. I'm not necessarily looking for the close but for any price above the previous high.

      Comment


        #4
        Originally posted by rcheezem View Post
        Thanks Cal. But I was wondering about the values between the close and the high. I'm not necessarily looking for the close but for any price above the previous high.
        Then use CalculateOnBarClose = FALSE

        Comment


          #5
          Hello rcheezem,

          Thank you for your response.

          Sledge is correct here, as the CalculateOnBarClose option will determine if we calculate on the close of the bar (True) or intra-bar (False). False would provide the desired effect here. For information on CalculateOnBarClose please visit the following link: http://www.ninjatrader.com/support/h...onbarclose.htm

          Please let me know if I may be of further assistance.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Spiderbird, Today, 12:15 PM
          2 responses
          10 views
          0 likes
          Last Post Spiderbird  
          Started by WHICKED, Today, 12:45 PM
          0 responses
          6 views
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Started by FrazMann, Today, 11:21 AM
          2 responses
          6 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Started by rjbtrade1, 11-30-2023, 04:38 PM
          2 responses
          80 views
          0 likes
          Last Post DavidHP
          by DavidHP
           
          Started by lorem, Yesterday, 09:18 AM
          5 responses
          18 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X