Coding help required using oscillator for price action trading

Forums ProRealTime English forum ProBuilder support Coding help required using oscillator for price action trading

Viewing 5 posts - 1 through 5 (of 5 total)
  • #32880

    Hi,

    How do I use an oscillator (stochastic or CCI) to determine a trend using price action.

    I need help coding the following, ideally based on 5m or 15m charts:

    Uptrend (higher lows and higher highs)

    1. current price is in the oversold area of the oscillator
    2. current price is higher than the previous oversold area

    Downtrend (lower highs and lower lows)

    1. Current price is in the overbought area of the oscillator
    2. current prices is lower than the previous overbought area

    See attached image which illustrates the above for an uptrend.

    #32970

    For an uptrend, a rough idea would be to store the lowest low of price within last X periods when the oscillator leave its oversold area and then compare this value with the previous stored one.

    How do you want to display this information? uptrend=1 if new value is superior to the last one?

    #33007

    Hi,

    I want the indicator to display the result as follows:

    0=no alert

    1=uptrend

    -1=downtrend

    #33013

    That’s fine, I quickly code something that should be relevant to your query (an example of how it looks is attached). Here is the code:

     

    #33467

    Nicolas, I had a look at your code, and it is great, I was wondering though if it would be possible to code  the following:

    • definition of a uptrend scenario
    1. there are 2 higher highs in the last x days period.
    2. there are 2 higher lows in the last x days periods
    • definition of a downtrend scenario
    1. there are 2 lower  highs in the last x days period.
    2. there are 2 lower lows in the last x days periods

    Thak you very much

    Francesco

Viewing 5 posts - 1 through 5 (of 5 total)

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