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

Actual Close price wanted

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

    Actual Close price wanted

    I'm creating a new indicator based on PriorDayOHLC.Close.

    The value of Close changes depending on Session end time, when I use my new indicator in a strategy.

    If I set the Session end time to the actual end time of the index, the return value is fine.

    But when I set the Session end time to the time where I want to stop trading that index, I get the high value reached by that timestamp. That of course is a different value.

    #2
    PriorDayOHLC will always return values based on your chart data. If your charting a lot of pre-market/after market data your close will be reflective of this. If you are chopping out the session your returns will be influenced as well.

    What I recommend since you are ultimately using a strategy is to use multi-time frame strategies and add a Daily bar object. Migrate all your logic that needs to be based on this value over to the strategy. Then just reference the daily bar object to get yesterday's close.

    Alternatively, you can also try just using a time filter instead of actually changing the chart's session begin/end times. This will limit your trading and will also allow you the flexibility to get accurate PriorDayOHLC values. Please see this reference sample: http://www.ninjatrader-support.com/v...ead.php?t=3226
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bmartz, 03-12-2024, 06:12 AM
    5 responses
    33 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by Aviram Y, Today, 05:29 AM
    4 responses
    13 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
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X