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 FrazMann, Today, 11:21 AM
            2 responses
            6 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Started by rjbtrade1, 11-30-2023, 04:38 PM
            2 responses
            80 views
            0 likes
            Last Post DavidHP
            by DavidHP
             
            Started by Spiderbird, Today, 12:15 PM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Started by lorem, Yesterday, 09:18 AM
            5 responses
            18 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            12 responses
            42 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X