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

Detect time intervals

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

    Detect time intervals

    Hi, i want an indicator to automatically adjust its parameters when i switch time intervals.
    how do i properly do something like:

    if ( current interval == PeriodType.Day, xx )
    {
    plot_1Set.( plotPeriod )

    }
    if ( current interval == PeriodType.Minute, xx)
    {
    plot_1Set.( plotPeriodMinute )

    }


    thanks in advance!
    Last edited by kabott; 03-28-2017, 08:51 AM.

    #2
    Hi again, any help will be appreciated, i just need the correct syntax, i have a vague idea on how to do it but dont know the syntax. little help please

    Comment


      #3
      Hello kabott,

      Thank you for your note and patience.

      I have attached an indicator which will print to the output window when the chart interval has changed. You should be able to use the sample to set up what you're looking to do.

      Please let us know if you need further assistance.
      Attached Files
      Alan P.NinjaTrader Customer Service

      Comment


        #4
        Thank you alan

        Comment


          #5
          Sorry to be a pain Alan, this goes way over my head, :P
          I was thinking something simpler like:

          OnBarUpdate

          if (current bar type == daily )

          plot.set (EMA ( 4 )[0])

          if (current bar type == Minute, 240)

          plot.set( EMA ( 24 )[0])


          something like that, perhaps its not possible to do without a deeper C# understanding? i cant decipher which parts of your script are relevant to what i need and which dont, i learned a little C# trough copy/ paste , brute force, try again.. this may take me weeks if not months to finally get the right syntax combination if ever, many times i give up and try an other way..

          could you help me solve this please? just the syntax that goes under OnBarUpdate

          Thank you again alan

          Comment


            #6
            Hello kabott,

            In the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners.

            You can also contact a professional NinjaScript Consultants who would be eager to create or modify this script at your request or assist you with your script. Please let me know if you would like our business development follow up with you with a list of professional NinjaScript Consultants who would be happy to create this script or any others at your request.

            Please let us know if you need further assistance.
            Alan P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by KenneGaray, Today, 03:48 AM
            0 responses
            3 views
            0 likes
            Last Post KenneGaray  
            Started by thanajo, 05-04-2021, 02:11 AM
            4 responses
            470 views
            0 likes
            Last Post tradingnasdaqprueba  
            Started by aa731, Today, 02:54 AM
            0 responses
            4 views
            0 likes
            Last Post aa731
            by aa731
             
            Started by Christopher_R, Today, 12:29 AM
            0 responses
            10 views
            0 likes
            Last Post Christopher_R  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            166 responses
            2,237 views
            0 likes
            Last Post sidlercom80  
            Working...
            X