TTM Squeeze Oscillator code

Forums ProRealTime English forum ProOrder support TTM Squeeze Oscillator code

  • This topic has 5 replies, 2 voices, and was last updated 2 years ago by avatarJS.
Viewing 6 posts - 1 through 6 (of 6 total)
  • #198001

    Hello hello,

    I would like to integrate the TTM Squeeze Oscillator in my trading strategy.

    Here is the link of the indicator coded by Nicolas : https://www.prorealcode.com/prorealtime-indicators/ttm-squeeze-oscillator-price-version/.

    To make things easier :), I would like to use 2 timeframes.

    For example, I want to place a buy order when the trend is bullish on the 30min chart and bullish on the 1min chart.

    I tried something below but I am not sure/convinced this is correct, can someone have a look please?
    I basically want to understand which elements in the indicator I should use to apply it to my strategy.

    Thank you in adcance!

    Best, Jo

     

    #198003
    JS

    Hi @jodal

    I have organised your code a bit so that the “calculations” are under the relevant time frames…

     

    1 user thanked author for this post.
    #198024

    Hi @JS

    Thanks a lot for your reply and reactivity.
    I have 3 questions:
    1.  Is it possible to take into account the momentum squeeze (green/red dots in the indicator)? So that one condition to execute the trade is that the market is trending (green dot).
    2. I would also like to consider ONLY when the trend is not decreasing( the light blue and red candle)
      I guess I need to include the “val” and “value” elements in the code?
    3. Do you confirm that with your code above, the update will be done at the end of each candle? For example, if the M30 candle at 15:00 meets all conditions, then every time a M1 candle meets the conditions between 15:30 and 16:00, an order will be executed?

    Have a nice day!

    Jo

    #198049
    JS

    Hi @jodal

    I think it should first be clear what all those beautiful colours stand for 😉

    In the original indicator it is described that when there is a consolidation going on that the points in the oscillator turn red and when the market is in a trend that the points turn green.

    When I look at the corresponding chart, I think it is the other way around, when there is a consolidation, the points turn green and when the market is in a trend the points turn red.

    When the BB falls within the KC then the volatility is low and there is a consolidation (points are green) and when the BB outside the KC then the volatility is high, and the market is in a trend (points are red).

    What I think are the best signals:

    Trend rising: red points + rising light blue (momentum increases in the rising trend)

    Trend downwards: red points + falling red (momentum increases in a downward trend)

    In code:

    Trend rising: sqzOn = 0 (red) and val > 0 and val > val[1] (light blue)

    Trend downwards: sqzOn = 0 (red) and val < 0 and val < val[1] (red)

    #198050

    Hi @JS,

    Thank you for your feedback and for thinking along with me!

    Actually there was a mistake from Nicolas in the original code (you can check the comments below the indicator code).

    So the trend is rising when : green points + rising light blue (momentum increases in the rising trend)

    and the trend is going downwards when : green points + falling red (momentum increases in a downward trend)

    Red points mean that we are in a consolidation.

    Or maybe I am mistaken?

    Does the code you proposed remain the same?

    #198051
    JS

    Hi @jodal,

    What I see in the original chart and in the original code is that a trend goes hand in hand with red dots and a consolidation with green dots…

    The code can be adapted to the conditions I have indicated:

    Trend rising: sqzOn = 0 (red) and val > 0 and val > val[1] (light blue)

    Trend downwards: sqzOn = 0 (red) and val < 0 and val < val[1] (red)

    (or do you want me to change the code?)

    1 user thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login