Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Percent move in a time window

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

    Percent move in a time window

    I'm not exactly sure where to start. Can you point me to some material that would help to develop a strategy that will trigger a trade when a instrument has moved up 15% in 60minutes?

    Would I do something like this with the primary bar being a 60min bar...

    if (Close[1] > (Open[1] * 1.15));
    {
    EnterLong()
    }

    I tried this and the previous 60min bar doesn't seem to have a 15% close above it's open. Is my formula off somehow?
    Last edited by zachj; 08-07-2013, 09:04 PM.

    #2
    zachj, the formula looks ok, you should not terminate the if statement with the ; though. Otherwise the EnterLong would just always be executed...in contrast please try:

    if (Close[1] > (Open[1] * 1.15))
    {
    EnterLong()
    }

    Comment


      #3
      Ok so if I'm running this on a primary bar of 60min, this will only allow the 15% change in an hours time window to happen during specific time intervals for instance 9:30-10:30 or 10:30-11:30. Is there a way to just use any 60min window for instance if there was a 15% move between any random time 9:47-10:47 or 10:03-11:03. So basically using a 1min or even tick time for the 60min window?

      Comment


        #4
        Correct, this will be then tied to the candle you're using on the 60 min series.

        With further custom coding you can save a reference point to calculate the move from.

        Comment


          #5
          Can you guide me to some info or maybe a sample strategy to get some hints?

          I suppose I could set primary to say a 5min and I could do if (Close[1] > (Open[1] * 1.15)) || (Close[1] > (Open[2] * 1.15)) || (Close[1] > (Open[3] * 1.15)) etc. That way it's looking back every 5min instead of every 60min? Or will that cause any issues?

          Comment


            #6
            I would unfortunately not be aware of any resource to point you to for that specific task. You could do that on the 5 min as well, but then you would need to be aware that it's taking those candles for comparisons so would not be the 60 minute frame you want to compare over.

            Comment


              #7
              Well was looking for within 60min, could be a 15% change within 10min or 20min etc. but no more than 60.
              So for instance if I did this below on a 10min time frame it would look back 20min or two 10min bars ago correct?..
              (Close[1] > (Open[2] * 1.15))

              and this would look back 60min..
              (Close[1] > (Open[6] * 1.15))

              So I could use Open[1], Open[2], Open[3], Open[4], Open[5], Open[6] to catch any 15% move within the last 60min.

              Comment


                #8
                That's correct, you could simulate the longer frame via multiple bar indices on a shorter one to search for the move.

                Comment


                  #9
                  Originally posted by zachj View Post
                  Can you guide me to some info or maybe a sample strategy to get some hints?

                  I suppose I could set primary to say a 5min and I could do if (Close[1] > (Open[1] * 1.15)) || (Close[1] > (Open[2] * 1.15)) || (Close[1] > (Open[3] * 1.15)) etc. That way it's looking back every 5min instead of every 60min? Or will that cause any issues?
                  Use a multi timeframe series: secondary series of 1-range bars. Then on each secondary bar, you compare the value to that 60 minutes ago (Use GetBar()).

                  Comment


                    #10
                    Originally posted by NinjaTrader_Bertrand View Post
                    With further custom coding you can save a reference point to calculate the move from.

                    So there's no information anywhere regarding saving a reference point?

                    Comment


                      #11
                      Originally posted by zachj View Post
                      So there's no information anywhere regarding saving a reference point?
                      You can save anything that you want. If what you want to save is a fixed reference, you just have to save it at the time that it is generated. The problem here is that you are asking for a moving window. Hence, your reference point is ipso facto not fixed. If something is dynamic, then it has to be referenced using some dynamic means.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      656 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      370 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      109 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      574 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      577 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X