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

RTH/ETH question

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

    RTH/ETH question

    Hello,

    I am trying to make an indicator that calculates the regular (only the trading hours without the night sesión) Begining and End time of current Session for the future ES. As I am working with an ETH chart the result is always a begin and end times that included the night hours. So, my question is if there is a way to get only the begin and end times without the night hours?.

    Thanks

    #2
    Hello Sangu,

    Thanks for your post.

    Yes, you can specify the begin and end times you wish to use for calculation and create a time filter for the indicator to only process between the begin and end times. For example (pseudo code)

    if (Time[0] >= starttime && Time[0] <= endtime)
    {
    // perform RTH calculations here
    }
    You can replace starttime and entime with the actual session times or you can create input variables that you can set (in case you might wish to change them without needing to re-write the strategy)

    Here is a link to a working example of a time filter: https://ninjatrader.com/support/help...to_limit_t.htm
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi Paul,

      Yes I am already using what you say but my idea is to have something automatic. Here in Spain (using CME futures) we have time differences twice a year due to the time change in winter and summer. There are around 5-6 days and twice a year where the sesión starts at 14:30 instead of 15:30 that is the regular starting time for the CME futures.

      I have already solved the problema using: the SessionIterator with BarsArray and ActualSessionBegin and AtualSessionEnd.

      Thanks a lot.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Conceptzx, 10-11-2022, 06:38 AM
      3 responses
      60 views
      0 likes
      Last Post NinjaTrader_SeanH  
      Started by f.saeidi, Today, 01:32 PM
      1 response
      2 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by mmckinnm, Today, 01:34 PM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by traderqz, Today, 12:06 AM
      9 responses
      16 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by kevinenergy, 02-17-2023, 12:42 PM
      117 responses
      2,766 views
      1 like
      Last Post jculp
      by jculp
       
      Working...
      X