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 PaulMohn, Today, 12:36 PM
    0 responses
    2 views
    0 likes
    Last Post PaulMohn  
    Started by love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    38 views
    0 likes
    Last Post love2code2trade  
    Started by alifarahani, Today, 09:40 AM
    2 responses
    14 views
    0 likes
    Last Post alifarahani  
    Started by junkone, Today, 11:37 AM
    3 responses
    20 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by frankthearm, Yesterday, 09:08 AM
    12 responses
    44 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Working...
    X