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

Referencing OHLC of cash session while trading futures session

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

    Referencing OHLC of cash session while trading futures session

    Hi,

    When using priorOHLC, my understanding is that it will use the session times the user specifies for the given instrument. (See: http://www.ninjatrader.com/support/f...t=cash+session)

    What I would like to do is trade during the futures session but be able to reference the instrument's prior cash session OHLC. Lets say as a generic example, instrument X futures open at 23:00 and close at 22:00 but the cash market opens at 14:30 and closes at 21:00. So I want to know the OHLC between 14:30 and 21:00. Is there a way to reference this time range and lookup the OHLC values?

    Thanks,
    darmbk.

    #2
    Darmbk,

    Thank you for your note.

    You would need to use the Time checks for the bars and create points where you can limit your codes' look back at the 14:30 and 21:00 bars.

    if(ToTime(Time[0]) >= 143000)
    {
    //Track the OHLC values here
    }

    else if(ToTime(Time[0]) >= 210000)
    {
    //reset values or start new tracking.
    }

    http://www.ninjatrader.com/support/h...tml?totime.htm

    Let me know if I can be of further assistance.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      How would I go about changing the settings of the priorOHLC indicator to have the previous close be the cash close (trading the ES, want the 4pm close not 415). I'm confused with the response you gave and I would appreciate some clarification.

      Thanks!
      rmaierle

      Comment


        #4
        Rmaierle,

        The example I gave will show you how to limit the times of the OHLC values that you want to track.

        Essentially, in the first time filter we are ensuring that the time is greater than the 2:30 time and if so then we will track the OHLC values that you want until we reach 9:00 pm when we reset the values

        Once the time has passed the 2:30 it will no longer update those values, meaning that the last close value we recorded would be the cash market value.
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          My question still is how do I actually go about changing these settings?

          Comment


            #6
            Rmaierle,

            Are you referring to the PriorDay settings or the script settings I have posted?
            Cal H.NinjaTrader Customer Service

            Comment


              #7
              The prior day settings. I want to be able to plot the indicator on a chart and have it register the close as being at 4pm and not the end of the session that I have set for the chart

              To clarify, my ES chart ends at 415. however, I want the "close" to register as being at 4pm

              Comment


                #8
                Rmaierle,

                You're not going to be able to change the PriorDay settings as this is a System indicator and cannot be modified.

                However, you can Save the PriorDay as a new indicator so that you can change any values in the code. This would not be ideal for you as the script does not use times to determine plotting but rather the session date instead.

                Darmbk was using a custom script to essentially put in his own tracking system for the OHLC values so that he could change the times to his needs per chart.
                Cal H.NinjaTrader Customer Service

                Comment


                  #9
                  Hello darmbk,
                  I wondered if you resolved your quest for showing cash market close, and if so would eb kind enough to share....?
                  I believe I have the same wish as you - I trade equity index futures and want to display price at the time of the corresponding cash market Close e.g. for YM, ES at the NY Close 4pm ET. Also (and some may consider curiously) the FDAX.
                  I've trawled extensively and your's seems to be nearest to what I want. I've seen Harry's (brain the size of a planet) contribution - my 'problem' is I have used Harry's SessionPivot suite for a long time so and will take them to my grave, but seems because I do so extensively I can't use a Session Template to artificially create a 4pm Close - it would screw up my ETH and RTH etc.
                  I do have an indicator for Cash Close but it has stopped working on FDAX and works incorrectly on ES.
                  Just wondered.....
                  TIA

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by BarzTrading, Today, 07:25 AM
                  2 responses
                  13 views
                  1 like
                  Last Post BarzTrading  
                  Started by devatechnologies, 04-14-2024, 02:58 PM
                  3 responses
                  19 views
                  0 likes
                  Last Post NinjaTrader_BrandonH  
                  Started by tkaboris, Today, 08:01 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post tkaboris  
                  Started by EB Worx, 04-04-2023, 02:34 AM
                  7 responses
                  162 views
                  0 likes
                  Last Post VFI26
                  by VFI26
                   
                  Started by Mizzouman1, Today, 07:35 AM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Working...
                  X