• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.


No announcement yet.

Partner 728x90


Version of 5 min VolStop for 1 min chart

  • Filter
  • Time
  • Show
Clear All
new posts

    Version of 5 min VolStop for 1 min chart

    On a 1 min chart I want to plot the value of Vol Stop from 5 minute data i.e. vol stop values from a 5 min chart plotted on the 1 min chart.
    Curr 5min vol stop value to be based on the most recently completed 5 min bar i.e. the value would not change for 1 min bars within the same 5 min bar.

    I copied the Vol stop indicator and changed it to use 5 min data.
    Main changes that I made to make it multi timeframe were to use:
    Closes e.g. Closes[1][0]

    I am not sure about:
    SignalClose = MIN(Closes[1],(aTRperiods))[0]; if that should be [1];
    Plotset.Set(SignalClose + (aTRmultiplier*ATR(BarsArray[1],aTRperiods)[1]));
    I am not sure if it should be [1])); or [0]));
    Also how to solve the issues below.
    Flipping when it should not and sometimes value changes within the same 5min bar.

    Tried various ideas to fix it but I have not come up with the right code yet.
    Could someone please assist to debug it.
    Files with original code and my 5 min version are attached. Screen shot also attached.
    Attached Files
    Last edited by skiguy; 09-19-2016, 02:01 AM.

    Hello skiguy,

    Thanks for your post.

    If I may suggest there is another approach that does not require (re)coding that may meet your needs.
    Basically you would add a 5 minute data series to the chart, hide the 5 minute data series then add the indicator and set the input of the indicator to the 5 minute data series. This will provide the 5 minute indicator output on the 1 minute chart.

    The process is pretty straightforward to do this and I've made a short how to video: http://screencast.com/t/rqm6I5CMjzD
    Paul H.NinjaTrader Customer Service


      Thanks Paul for your suggestion. The short video was a superb idea as it made it crystal clear what to do.

      I have done that and I will verify against my 5 min chart "flips" for 9/16.

      There first thing that comes to mind is that NT uses bar close as the time hence 0600 5min chart flip could not happen until close of 0600 1 min bar for example. So if 0559 close exceeds buy stop but 0600 does not then there would not be a "flip" to long as the 5 min bar does not close until end of 0600 bar.

      Expressed more generically, NT 5 min bar close is at ..05, ..10, ..15 etc

      Hence at ..06 (for example) code should not be considering if there is a "flip" as it is not relevant.

      Hope that makes sense.
      Last edited by skiguy; 09-20-2016, 02:19 AM.


        If I look at your chart, I am seeing strange things. In my opinion

        - A stop should not move away from price, while price moves away from the stop. I would rather leave it in place.

        - Also a stop should not make giant leaps towards price, when price does not move. Otherwise you will be stopped out, because the stop has moved towards price, not because the price has moved. You can see such leaps on the right hand side of both your charts. In both cases these leaps would have taken you out of a profitable position.

        When correctly coded a stop does not move away from price. Also it should not cut into price.

        Then there is no need to use a higher timeframe data series to code a volatility based stop. If you wish to calculate the stop from a 5 min chart and apply it to a 1 min chart, it is possible to approximate the 5-min ATR by multiplying the 1-min ATR with a factor f = sqrt(5) = 2.24,

        Below is a chart with a Chandelier Stop applied. I have applied it to exactly the same bars that you have posted.

        I have used a ATR(25) on the 1-min chart (reference period 25 mins equivalent to an ATR(5) on a 5-min chart). The ATR multiplier is 1.5 and the conversion factor 2.24. This makes up for a composite multiplier m = 1.5 * 2.24 = 3.36.
        Attached Files


          Thanks Maestro Harry.

          Absolutely agree it should not move away. That was one of the issues I observed and was the major giveaway that my coding was flawed

          I will try your solution.


            Hi Harry,

            When I try to download the file I get the following:

            "It seems we can’t find what you’re looking for. Perhaps searching, or one of the links below, can help"

            I will send you an email as well. Posting here in case you see this first.


              I want to publically acknowledge Harry's contribution. He fixed the broken link the same day I drew it to his attn and thanked me for highlighting that it did not work.

              I was trying to replicate the Vol Stop indicator from CQG platform which works as you would expect (see Harry's comments on odd behaviour versus what one should expect).

              The base Vol Stop I had downloaded for NT had flaws that were made even more obvious on higher timeframe.

              Harry's version works as he described and by using my own inputs I can replicate what I see in CQG which is what my original goal was. His version also has many other nice options such as displaying arrows etc.

              I found his tip on the sqrt to be a good one also. It does not totally replicate what happens on the higher timeframe exactly but it is very close. IIRC Harry even called out that it would not replicate exactly.

              The indictor loads instantly on my laptop which suggests efficient coding.

              He really goes the extra mile. Thanks again Harry.


                @skiguy, are you able to share the updated volstop indicator code?

                Thank you


                  Originally posted by wsDK_II View Post
                  @skiguy, are you able to share the updated volstop indicator code?

                  Thank you
                  Go to Harry's site (http://www.lizardtrader.com) and become a member (it is free) then you will be able to download his indicator.It is under trailing stops.
                  Last edited by skiguy; 09-26-2016, 09:56 PM.


                  Latest Posts


                  Topics Statistics Last Post
                  Started by Stefan1999, Today, 08:15 AM
                  1 response
                  Last Post NinjaTrader_Kate  
                  Started by stewarco, Today, 07:56 AM
                  1 response
                  Last Post NinjaTrader_Jesse  
                  Started by traderMNQ, Today, 07:16 AM
                  1 response
                  Last Post NinjaTrader_Kate  
                  Started by ntdev, Today, 07:45 AM
                  1 response
                  Last Post NinjaTrader_Jim  
                  Started by marcus2300, Today, 07:08 AM
                  1 response
                  Last Post NinjaTrader_Clayton