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

new indicator need time left in bar

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

    new indicator need time left in bar

    I'm trying to make an indicator that will alarm when the price moves x points within x amonut of time. i tried to use the bartimer indicator in my code but it will not work. i saw there is a Bar.PercentComplete would this work the same way.
    Last edited by cbart_1; 10-17-2011, 12:55 PM. Reason: misspelling

    #2
    cbart_1,

    What sort of time frame are you looking at? Over how long of an interval are you testing this? It seems like you are looking at using a discrete derivative. I.e. change in Price over change in Time.



    Something like :

    ( Close[0]-Close[5] ) / (0 bars - 5 bars) would work unless you have specific requirements as to the time, i.e. you are on a 60 minute chart and want to calculate the difference based on 1 minute times or something. This is only required to maintain the proper units.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      I would like for it to work on any 1, 15, or 30 minute chart. So really i need to know how much time is left in a bar or how much time has passed since the open of the bar.

      Comment


        #4
        Over what period are you calculating the difference, is it intra-bar? Or are you calculating it across a few bars? Essentially. you don't really need to use units of time if you think of your time as each "bar". Then its just a simple difference Close[a]-Close[b] or whatever.

        It just depends on how important having actual time as your units are, i.e. if you want Change in price / minute or Change in price / bar.
        Last edited by NinjaTrader_AdamP; 10-17-2011, 03:01 PM.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          got it

          ok i figured it out. i just needed to know if the price went a certain amout of points in 1 15 minute bar in a few minutes. i used the Bars.PercentComplete to do it.
          Last edited by cbart_1; 10-18-2011, 09:50 AM. Reason: typo's

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Vulgoth_t_Destroyer, 05-09-2022, 04:45 PM
          55 responses
          5,455 views
          0 likes
          Last Post BartMan
          by BartMan
           
          Started by DawnTreader, 05-08-2024, 05:58 PM
          16 responses
          52 views
          0 likes
          Last Post DawnTreader  
          Started by tradingnasdaqprueba, 05-07-2024, 03:42 AM
          15 responses
          61 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by kevinenergy, Yesterday, 12:01 PM
          8 responses
          28 views
          0 likes
          Last Post kevinenergy  
          Started by nightstalker, Today, 01:32 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Working...
          X