Stuck with coding indicator about RSI divergences

Forums ProRealTime English forum ProBuilder support Stuck with coding indicator about RSI divergences

Tagged: 

Viewing 11 posts - 1 through 11 (of 11 total)
  • #93623

    Dear All,

    I am new to this forum so I don’t know if I am at the right place here so please forgive me if I am wrong. I attatched an printscreen of a FDAX 5′ PRT chart from 14-15/01/2019.

    I have an idea for an indicator and someone helped me to code it in PRT but has no more time and the code doesn’t work properly and I don’t know anything about coding and unfortunately, at the moment, don’t have the time to learn it.

    I have the following variables: LOW1, LOW2 and LOW3, CLOSE1, CLOSE2 and CLOSE3, RSI1, RSI2 and RSI3

    1. With the red candle at 1 the RSI goes below 29 (RSIBottom1). Then the “system” starts and I get a 1st value for the variable RSI1 = the rsi value of that current candle, nml 28.93 so RSI1 = 28.93 This is also linked to a low nml LOW1 = low value of that current candle, here 10881 and also a value for the current close = CLOSE1 = here 10883.5.

    2. The following candle has a lower low but a higher close (1 point higher close is enough) and that close is also higher than the “open”. Here the current candle is low <LOW1 and so the value of the variable LOW1 becomes the new low of the current green candle, here 10876.5. So LOW1 = 10876.5 The rsi is not lower so RSI1 remains the same (RSI1 = 28.93). From that close current bar> = CLOSE1 +1 point the candleteller also starts to run (numberofbars) CLOSE1 also remains at the same value (CLOSE1 = 10883.5)

    3. With the third candle we have no lower low nor rsi so the values ​​for RSI1 and LOW1 remain the same

    4. In the fourth candle the index is about 10896.5 and therefore more than 20 points difference with LOW1 (moveupafterlow). From now on we will search / see if we get a new low that <LOW1 (10881) with a close that <CLOSE1 and rsi> RSI1. The variables CLOSE1, RSI1 and LOW1 remain the same. (Note: If from now on the index should rise so fast that the RSI exceeds 70, the whole system will be canceled and we have to start from the beginning.)

    5. The lower low <10881 only arrives at the red candle “2”.

    1.  The low of this red candle to 2 is 10862 this is <LOW1 so we have a value for LOW2; 
    2. The corresponding rsi value of this candle is 31.04 and this is> RSI1 so new variable RSI2 = 31.04 and 
    3. the close of this candle is 10863 what <CLOSE1 so new variable CLOSE2 = 10863 and
    4. the number of candles is <30 (numerofbars)

        All first conditions are met. Now the last one

    6. The next candle MUST be a green candle where the close of this green candle> = 10865 (or CLOSE2 +2 points) and it must be a real hammercandle so (high-close) +2 <(open-low) The low of this candle may be <LOW2 but that’s not obligatory.

    If all these criteria are met then the indicator should mention “1” AND all variabeles should be reset. Only if thereafter the RSI drops below 29, the system should restart from the beginning.

    Hence nothing happens at 4 (1st green candle after 4 is not a hammer), but something should happen at the red 5 because here again there is a lower low (LOW3 <LOW2) and a lower close (CLOSE3 <CLOSE2) and rsi (RSI3> RSI1) and index has risen more than 20 points since LOW2and the green candle 5 is a hammer with close> = CLOSE3 + 2 points.

     

    Normally the indicator should also be usable in the 1 “, 10”, 30 “etc …

    #93624

    I hereby resend the printscreen

    #93650
    #93757

    Dear Roberto,

    Many thanks for your reply. If I try to use the first, my program says that there are coding errors (printscreen)

    The second (open source) indeed gives a signal when there is a divergence, but not exactly as my needed specifications.

    I want a signal exactly when the requirements are met. In this way I can save serious in-front-of-screen time 🙂

    How can I adjust this?

    Many thanks for your effort and time!

     

     

    #93775

    Those reported errors seem related to some missing/mispelled IF…ELSIF…ENDIF or maybe due too many nested structures, you have several IF’s within a FOR…NEXT structure which belongs to another outside IF…ENDIF.

     

    #93800

    Dear Roberto,

    The printscreen if from when I open the /rsi-classical-hidden-divergences-indicator/ 

    So I don’t know what I do wrong.

    I have the same problem when I import other indicators from the library here.

    Sometimes it’s ok and sometimes I get an error mention, but unfortunately I don’t know anything about coding.

    Do you have any suggestions?

    Kind regards,

    Ladis

    #93807

    The code runs finely, it’s something missing, check if you did Copy & Paste. Try importing the .ITF file

    #93808

    I imported te itf file. I will try to copy and paste.

    #93809

    I tried thaty but it didn’t work.

    I imported it and then applied on “validate program” and then the error box opens?! (see printscreen)

    #93811

    Which version of PRT are you using? I think it needs to be 10.3 for the graphic instructions to work.

    #93812

    V10.2 It comes with my brokers (Binckbank) software

    Thank you.

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

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