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

Avoiding opening gaps in oscillator

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

    Avoiding opening gaps in oscillator

    Hello,

    I am thinking in a method to avoid that an oscillator is affected with a big opening GAP. Like in the attached example that there is a gap up of 18 points in ES futures. The problem is that the oscillator also gaps up so much and its measures are incorrect until it corrects the gap.

    Any idea or example with similar solution?

    Thanks and regards,
    Attached Files

    #2
    Hello Sangui,

    Thank you for your post.

    As the indicator is based on the price values then it moves with the price. I am not aware of any recommended means to buffer the values and ensure the gaps do not cause the indicator to gap. What exactly this would be is up to interpretation, do you have any ideas on what you would like to occur instead? How would you keep the values accurate?

    Please let met know if you have any questions.

    Comment


      #3
      Well, I have an idea that is using AddDataSeries, like this:

      AddDataSeries(stringinstrumentName,BarsPeriodbarsPeriod,stringtradingHoursName)

      But I don't know how to use it very well, could you help me to configure the above with the following data:

      Trading Hours: CME US Index Futures ETH
      Instrument: the current one. In this case ES06-17
      Period Type: Minutes
      Period: 5 minutes

      Thanks in advance.

      Comment


        #4
        Hello Sangui,

        Thank you for your response.

        So is the primary series a RTH Trading Hours template and you are thinking a secondary series could keep track of the movement in between the close and open of the RTH Trading Hours?

        I look forward to your response.

        Comment


          #5
          The primary series is RTH and I would like to use the oscillator with ETH by using something like:

          BarsPeriod bp = new BarsPeriod(); bp.BaseBarsPeriodType = BarsPeriodType.Minute; bp.BaseBarsPeriodValue = 5; AddDataSeries(Instrument.ToString(), bp, 5, "CME US Index Futures ETH", false);

          But I don't know if that is correct or not.

          Comment


            #6
            Hello Sangui,

            Thank you for your response.

            That is correct, although the Instrument is unlikely to have loaded yet. So you would want to writ ethe string directly to the overload. For example:
            Code:
            AddDataSeries("ES 09-17", bp, 5, "CME US Index Futures ETH", false);
            Please let me know if you have any questions.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by AttiM, 02-14-2024, 05:20 PM
            12 responses
            213 views
            0 likes
            Last Post DrakeiJosh  
            Started by cre8able, 02-11-2023, 05:43 PM
            3 responses
            238 views
            0 likes
            Last Post rhubear
            by rhubear
             
            Started by frslvr, 04-11-2024, 07:26 AM
            8 responses
            117 views
            1 like
            Last Post NinjaTrader_BrandonH  
            Started by stafe, 04-15-2024, 08:34 PM
            10 responses
            47 views
            0 likes
            Last Post stafe
            by stafe
             
            Started by rocketman7, Today, 09:41 AM
            3 responses
            12 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X