Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Default Fill type - using last close instead of NextOpen

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

    Default Fill type - using last close instead of NextOpen

    Hi, I have a need to use the closing price of the last bar instead of the NextOpen, which is what the Default Fill Type currently uses. Is this possible at all?

    It appears that LastClose is not implemented, so perhaps there is a way to access the price data series from within the fill type? Close[1] doesn't seem to work.

    Thanks -Dave

    #2
    Hello Dave,

    Thank you for your post.

    There is no method to pull historical bar values using a bars ago index (i.e. Close[1]) in the public class FillType.

    This is an unsupported area of NinjaScript, I will have to follow up with my colleagues to see if they are aware of a method to pull the previous bar's close in the public class FillType. When I have additional information, I will follow up with you on this thread.

    Comment


      #3
      Hello Dave,

      Thank you for your patience.

      My colleagues pointed to me to a very helpful post here on the Support Forum: http://www.ninjatrader.com/support/f...92&postcount=3

      Within the user's example they use Strategy.Closes[0][0] in place of what we tried (Close[1]). The use of Strategy give us access to the Strategy Base. Using Closes[0][0] ensures we access the main data series.

      So for this case we would use Strategy.Closes[0][1] to access to the previous bar's close of the main data series.

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

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      83 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      47 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      29 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      32 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      66 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X