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

Getting Yesterday's ES RTH High and Low

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

    Getting Yesterday's ES RTH High and Low

    I wrote a script to calculate the average ES RTH Daily Range by adding a secondary data series.

    Code:
    AddDataSeries(null, new BarsPeriod{ BarsPeriodType = BarsPeriodType.Minute, Value = 450}, "US Equities RTH");
    . Intended for 9:30am to 5:00pm.

    And I calculate the daily range by
    Code:
    if (BarsInProgress == 1) {
        _dayRange[0] = Highs[1][0] - Lows[1][0];
    }


    I am able to get most of the daily ranges correctly, but there are just some days with incorrect values. for example, holidays and fomc days. Why and how can I fix this?

    For example: The FOMC day on the left should have a daily range of 73.75pts but the scripts from above calculates it as 71.75pts.
    Click image for larger version

Name:	image.png
Views:	112
Size:	116.8 KB
ID:	1279394

    #2
    Hello dwrety,

    Try using 1440 for the number of minutes for a daily bar.

    Print the bar time, high and low to see if these are corresponding with the data on the chart.
    https://ninjatrader.com/support/foru...121#post791121

    Just to confirm, you have not modified the 'US Equities RTH' trading hours template have you? This should still be showing the holidays in the Trading Hours window.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello dwrety,

      Try using 1440 for the number of minutes for a daily bar.

      Print the bar time, high and low to see if these are corresponding with the data on the chart.
      https://ninjatrader.com/support/foru...121#post791121

      Just to confirm, you have not modified the 'US Equities RTH' trading hours template have you? This should still be showing the holidays in the Trading Hours window.
      Thank you Chelsea. Yes, I have changed the RTH hour templates and I tried both the original and the modified. The results were the same. Now I simply switched to an alternative method, which is to use PriorHOLC values and it's correct now. I am just curious why the results are off.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,404 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by Shai Samuel, 07-02-2022, 02:46 PM
      4 responses
      95 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by DJ888, Yesterday, 10:57 PM
      0 responses
      8 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by MacDad, 02-25-2024, 11:48 PM
      7 responses
      159 views
      0 likes
      Last Post loganjarosz123  
      Started by Belfortbucks, Yesterday, 09:29 PM
      0 responses
      8 views
      0 likes
      Last Post Belfortbucks  
      Working...
      X