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 bmartz, 03-12-2024, 06:12 AM
      4 responses
      31 views
      0 likes
      Last Post bmartz
      by bmartz
       
      Started by Aviram Y, Today, 05:29 AM
      4 responses
      11 views
      0 likes
      Last Post Aviram Y  
      Started by algospoke, 04-17-2024, 06:40 PM
      3 responses
      28 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by gentlebenthebear, Today, 01:30 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by cls71, Today, 04:45 AM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X