Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pre Market High & Low, and today's opening price indicators?

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

    Pre Market High & Low, and today's opening price indicators?

    Hi

    Do we have an indicator that displays the Pre Market High & Low, and today's opening price indicators?

    Thanks.

    #2
    Hello Irukandji,

    Thank you for your post.

    For the opening price, you could use the Current Day OHL indicator that's built into NinjaTrader. In that indicator's preferences, you choose to only plot the open.

    I'm unaware of any particular indicator that just shows the premarket high and low. However, it's quite possible that one may be available through a 3rd party, or you could theoretically create your own.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      You can do what you desire by using custom Trading hours Session templates and adding an extra Data Series to the same chart Panel' along with the platform's built in Current Day OHL indicator.

      Basically what you need to do is add an extra Data Series to your chart(s) with it using a custom Trading Hours template that specifies Pre-market Session hours (so you've got a separate data series of just pre-market activity..

      Then, attach a Current Day OHL built-in Platform indicator to it, and the indicator will thus show the High and Low of the pre-market Session data that it is attached to (the Overnight Session OHL).

      It doesn't matter what happens once the Day Session opens, because this extra data series, and the Current OHL indicator attached to it, will not see the day session data because its Trading Hours template will not include that time period, the Overnight Session will end at 09:30 EST, according to the template, thus 'fixing' the Overnight Session's High and Low at that time/thereafter and continue to plot them through the day session.

      It is recommended that you use Line chart Style and set it to Transparent for this extra Data Series so that it uses minimum resources i.e. isn't rendering candles etc. All you want is the overnight data for the OHL to work from, you don't actually need/want the data drawn (it will be drawn by other data series in the chart panel if you use an ETH Trading Hours template. If you use an RTH template, you won't see the overnight, unless you plot the candles. I'm sure you get the idea.

      Search for a Ninja video on using Multiple Data Series in the same chart/chart panel, can't recall who made it.

      You can save everything you need, so that your desired setup becomes default if you want it to i.e. instrument with attached Trading Hours templates, multiple data series in the same panel etc through using a combination of Chart templates and Instrument settings defaults so that you don't have to attach multiple data series and trading hours templates, change chart style to Line and transparent every time etc. etc and all that malarkey.

      Took me no end of grief to get what is a relatively simple thing (conceptually) with Support's assistance. Apparently, according to Ninja, no-one wanted to be able to see and use both ETH and RTH together, which is why it is 'either/or only' by platform default and no built-in or add-on other way to do this. Beats me....
      Last edited by brucerobinson; 05-06-2019, 07:58 AM.

      Comment


        #4
        Originally posted by brucerobinson View Post
        Apparently, according to Ninja, no-one wanted to be able to see and use both ETH and RTH together, which is why it is 'either/or only' by platform default and no built-in or add-on other way to do this. Beats me....
        Yeah right, agreed. Every single trading room I've ever been in, EVERYONE has and is looking at post/pre-market data on their charts.

        It should be as easy as just a single switch to turn it on or off.

        Last edited by Irukandji; 05-11-2019, 10:36 AM.

        Comment


          #5
          Bruce,

          Is there some way to add this code to a strategy that stores the Premarket high and low to be applied later in the same strategy that is using the RTH? So you would be using more than one trading hours in the same strategy?

          Comment


            #6
            Hello MathWiz,

            Thank you for your reply.

            It would be simplest to just use a single ETH data series that uses time filters to control entry to only enter during RTH hours, so then you could calculate the high/low from the ETH Session open to the current bar when RTH hours start, save those to variables, and then use them as you wish for your entries.

            It is possible to add a secondary series with a different trading hours template to a strategy, but you have to keep in mind mind that: An indicator / strategy with multiple DataSeries of the same instrument will only process realtime OnBarUpdate() calls when a tick occurs in session of the trading hour template of all added series. Any ticks not processed will be queued and processed as a tick comes in for all subsequent DataSeries.

            Please let us know if we may be of further assistance to you.
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              Kate,

              Are you talking about manually entering the pre session highs or lows into a variable? That's where I have been stuck, in finding a way for the strategy to automatically store those highs and lows for later application. Is the proper code PreMktHigh = Highs[1][0] where 1 is 1 minute bars?

              Comment


                #8
                Hello MathWiz,

                Thank you for your reply.

                Highs[1][0] would simply give you the high of the current 1 minute bar. It sounds like you're looking for the highest high and lowest low of the preceding bars from the start of the ETH Session, is that correct?

                If so, you could use a session iterator to find the first bar of the session, then once you hit the RTH start time, save the highest high and lowest low values to a plot. I've made a fairly simple example that will plot the highest high and lowest low of the premarket over the RTH session bars. This needs to be run on an ETH chart to function properly.

                Please let us know if we may be of further assistance to you.
                Attached Files
                Kate W.NinjaTrader Customer Service

                Comment


                  #9
                  A few questions how to apply this. Am I applying to 1 minute bars and using "High"? I see that is allows me to enter in the hours of the RTH. Does that mean it is gathering that data from previous day RTH close? I am only using it for a 1.5 hour period of the pre-morning period. Would I just use an end of the RTH as 8:00 am? Or will it think that is the morning of the prior day?

                  Comment


                    #10
                    Hello MathWiz,

                    You can apply it to minute bars, I personally used 30 minute bars using the Last data to more easily see the plotted lines. It only checks for the highest high and the lowest low from the ETH open until the time specified by RTHHoursStart and then plots those values until the time specified by RTHHoursEndTime.

                    Please let us know if we may be of further assistance to you.
                    Kate W.NinjaTrader Customer Service

                    Comment


                      #11
                      Kate, can't get this to fit into my strategy without errors. The second region at the bottom, do I leave all of that intact, or just use the strategy language? Tried both and always errors. Can you do a screen share?

                      Comment


                        #12
                        Hello MathWiz,

                        Thank you for your reply.

                        Just to be clear, in platform support, we do not create/write strategies, we do not provide debugging services. We also cannot provide programming education services. If you would like the strategy created for you, we can provide references to 3rd party programmers who could meet your needs. We also cannot debug or modify a script on your behalf. This means that if we are on the phone/screen share, if you have questions about the logic of a script, we would need to end the call and assist with the debugging process through email. I can assist by demonstrating how to use prints, comments, and the output window to understand the behavior of a script.

                        If you are referring to the #region NinjaScript Generated Code, that should be omitted if you are moving the indicator's logic into a strategy. You could consider simply calling the indicator from your strategy if you wish.

                        Here's a quick example of calling the example indicator from within a strategy and drawing the current highest high and lowest low values as a fixed text drawing object on the chart:

                        Code:
                         public class ExampleUseGetHighLowPremarketInStrategy : Strategy
                        {
                        private ExampleGetHighLowOfPremarket ExampleGetHighLowOfPremarket1;
                        
                        protected override void OnStateChange()
                        {
                        if (State == State.SetDefaults)
                        {
                        Description = @"Enter the description for your new custom Strategy here.";
                        Name = "ExampleUseGetHighLowPremarketInStrategy";
                        Calculate = Calculate.OnBarClose;
                        EntriesPerDirection = 1;
                        EntryHandling = EntryHandling.AllEntries;
                        IsExitOnSessionCloseStrategy = true;
                        ExitOnSessionCloseSeconds = 30;
                        IsFillLimitOnTouch = false;
                        MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
                        OrderFillResolution = OrderFillResolution.Standard;
                        Slippage = 0;
                        StartBehavior = StartBehavior.WaitUntilFlat;
                        TimeInForce = TimeInForce.Gtc;
                        TraceOrders = false;
                        RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
                        StopTargetHandling = StopTargetHandling.PerEntryExecution;
                        BarsRequiredToTrade = 20;
                        // Disable this property for performance gains in Strategy Analyzer optimizations
                        // See the Help Guide for additional information
                        IsInstantiatedOnEachOptimizationIteration = true;
                        RTHHoursStart = DateTime.Parse("07:30", System.Globalization.CultureInfo.InvariantCulture) ;
                        RTHHoursEndTime = DateTime.Parse("15:00", System.Globalization.CultureInfo.InvariantCulture) ;
                        }
                        else if (State == State.Configure)
                        {
                        }
                        else if (State == State.DataLoaded)
                        {
                        ExampleGetHighLowOfPremarket1 = ExampleGetHighLowOfPremarket(Close, RTHHoursStart, RTHHoursEndTime);
                        ExampleGetHighLowOfPremarket1.Plots[0].Brush = Brushes.Green;
                        ExampleGetHighLowOfPremarket1.Plots[1].Brush = Brushes.Red;
                        AddChartIndicator(ExampleGetHighLowOfPremarket1);
                        }
                        }
                        
                        protected override void OnBarUpdate()
                        {
                        if (BarsInProgress != 0)
                        return;
                        
                        if (CurrentBars[0] < 1)
                        return;
                        
                        Draw.TextFixed(this, "myText", ExampleGetHighLowOfPremarket1.HighestHigh[0] + " High | " + ExampleGetHighLowOfPremarket1.LowestLow[0] + " Low", TextPosition.BottomLeft);
                        }
                        
                        #region Properties
                        [NinjaScriptProperty]
                        [PropertyEditor("NinjaTrader.Gui.Tools.TimeEditorKey")]
                        [Display(Name="RTHHoursStart", Description="Time for Start of RTH session", Order=1, GroupName="Parameters")]
                        public DateTime RTHHoursStart
                        { get; set; }
                        
                        [NinjaScriptProperty]
                        [PropertyEditor("NinjaTrader.Gui.Tools.TimeEditorKey")]
                        [Display(Name="RTHHoursEndTime", Description="Time for End of RTH hours", Order=2, GroupName="Parameters")]
                        public DateTime RTHHoursEndTime
                        { get; set; }
                        #endregion
                        
                        }
                        Please let us know if we may be of further assistance to you.
                        Kate W.NinjaTrader Customer Service

                        Comment


                          #13
                          Kate, I am using this strategy applying to multiple stocks in the Control Center area, not applying to charts. Do you have an example of your strategy in such application without the print and draw commands?.

                          Comment


                            #14
                            Hello MathWiz,

                            Thank you for your reply.

                            The intent of the sample is simply to demonstrate how to call the indicator within the strategy and access the indicator's values. The examples we provide are intended to give you further direction to move forward, and are not intended to be used for copy and paste purposes.

                            AddChartIndicator() is what adds the strategy to a chart to display it - if the strategy is run from the Control Center instead, it would simply skip this since there's no chart to add it to. The actual indicator being called would still return values to the strategy.

                            In the example, we use ExampleGetHighLowOfPremarket1.HighestHigh[0] and ExampleGetHighLowOfPremarket1.LowestLow[0] to get the current highest high and lowest low values from the indicator. You can use these to get those values in your own logic.

                            Please let us know if we may be of further assistance to you.
                            Kate W.NinjaTrader Customer Service

                            Comment


                              #15
                              Kate, I see you are using OnBarClose to calculate. I am using OnPriceChange. Will that have any negative impact?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Belfortbucks, Today, 09:29 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post Belfortbucks  
                              Started by zstheorist, Today, 07:52 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post zstheorist  
                              Started by pmachiraju, 11-01-2023, 04:46 AM
                              8 responses
                              150 views
                              0 likes
                              Last Post rehmans
                              by rehmans
                               
                              Started by mattbsea, Today, 05:44 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post mattbsea  
                              Started by RideMe, 04-07-2024, 04:54 PM
                              6 responses
                              33 views
                              0 likes
                              Last Post RideMe
                              by RideMe
                               
                              Working...
                              X