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

Get low and high of over night Session (before CBOE US Index Futures RTH) of each day

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

    Get low and high of over night Session (before CBOE US Index Futures RTH) of each day

    Hi,

    I tried to use CurrentDayOhl to get high and low of today and i want to stop updating when the session if CBOE US Index Futures RTH starts ,
    also i think that's not a good idea to use CurrentDayOhl, do you have any suggestion on haw to get today's High and low for sessions before CBOE US Index Futures RTH of each day loaded in the chart, so i can draw zones for each day?

    Thank you in advance,
    Attached Files

    #2
    Hello pechtri,

    Thanks for your post.

    The CurrentDayOHL indicator that comes default with NinjaTrader will return the current day (session) Open, High, or Low price for the current session.

    CurrentDayOHL(): https://ninjatrader.com/support/help...nt_day_ohl.htm

    If you would like to get the CurrentDayOHL values for a different trading hour template, you could add an additional secondary series to the script using the AddDataSeries() method and specify the tradingHoursName you want to use within the AddDataSeries() method.

    AddDataSeries(string instrumentName, BarsPeriod barsPeriod, string tradingHoursName)
    AddDataSeries(string instrumentName, BarsPeriod barsPeriod, string tradingHoursName, bool? isResetOnNewTradingDay)


    Then, you could instantiate the CurrentDayOHL indicator using the BarsArray of the added series, such as BarsArray[1], and then access the current Open, High, or Low price of that indicator calculating from the added series.

    AddDataSeries(): https://ninjatrader.com/support/help...=adddataseries

    Working with Multi-Timeframe/Multi-Instrument NinjaScripts: https://ninjatrader.com/support/help...nstruments.htm

    If you want to get the CurrentDayOHL values at a certain time of day, you could create a Time Comparison condition that checks if the current time is equal to a specific time of day and then access the CurrentDayOHL values at that time of day.

    Creating Time Comparison: https://ninjatrader.com/support/help...arisons​
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Haiasi, 04-25-2024, 06:53 PM
    2 responses
    17 views
    0 likes
    Last Post Massinisa  
    Started by Creamers, Today, 05:32 AM
    0 responses
    5 views
    0 likes
    Last Post Creamers  
    Started by Segwin, 05-07-2018, 02:15 PM
    12 responses
    1,786 views
    0 likes
    Last Post Leafcutter  
    Started by poplagelu, Today, 05:00 AM
    0 responses
    3 views
    0 likes
    Last Post poplagelu  
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,407 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Working...
    X