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 samish18, 04-17-2024, 08:57 AM
      27 responses
      116 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by ETFVoyageur, 04-30-2024, 02:04 PM
      7 responses
      43 views
      0 likes
      Last Post eDanny
      by eDanny
       
      Started by f.saeidi, Today, 07:07 AM
      5 responses
      14 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Creamers, 04-27-2024, 05:32 AM
      9 responses
      60 views
      0 likes
      Last Post Creamers  
      Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
      19 responses
      59 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X