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 elirion, Today, 01:36 AM
          0 responses
          2 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by gentlebenthebear, Today, 01:30 AM
          0 responses
          2 views
          0 likes
          Last Post gentlebenthebear  
          Started by samish18, Yesterday, 08:31 AM
          2 responses
          9 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by Mestor, 03-10-2023, 01:50 AM
          16 responses
          389 views
          0 likes
          Last Post z.franck  
          Started by rtwave, 04-12-2024, 09:30 AM
          4 responses
          31 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Working...
          X