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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      102 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      144 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      71 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      125 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      79 views
      0 likes
      Last Post PaulMohn  
      Working...
      X