Risk/Reward Tool showing R multiples

Risk/Reward Tool showing R multiples

A request was made on the platform support forum to display entry price and stop loss for an anticipated trade with a risk/reward tool showing « R » multiples, R being the risk taken, without using the fibo tool reconfigured:

https://www.prorealcode.com/topic/risk-reward-tool-showing-r-multiples/

Until PRT includes this suggestion in a future version, here is a probuilder code proposal to achieve this.

Enter « myentry » and « mystop » values in the indicator parameters window, as well as the « Nbarres » number of bars to the right to draw the levels and text.

(As usual, download the file rather than copy-paste if you want parameters already created for the properties window)

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Abouadam2 • 07/20/2021 #

    it helps thanks

  2. Khaled • 07/20/2021 #

    Very useful. Thank you!

  3. jonpt88 • 07/20/2021 #

    Could someone kindly modify the code until 10R? Would that be possible…

    • JC_Bywan • 07/20/2021 #

      Hi, here it is modified for 10R:

      defparam DRAWONLASTBARONLY=true

      LeR=myentry-mystop
      OneR=myentry+LeR
      TwoR=myentry+LeR*2
      ThreeR=myentry+LeR*3
      FourR=myentry+LeR*4
      FiveR=myentry+LeR*5
      SixR=myentry+LeR*6
      SevenR=myentry+LeR*7
      EightR=myentry+LeR*8
      NineR=myentry+LeR*9
      TenR=myentry+LeR*10

      if islastbarupdate then
      DRAWSEGMENT(barindex, myentry, barindex+Nbarres, myentry) style(dottedline,1)
      DRAWSEGMENT(barindex, mystop, barindex+Nbarres, mystop) coloured(255,0,0) style(dottedline,1)
      DRAWSEGMENT(barindex, oneR, barindex+Nbarres, oneR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, twoR, barindex+Nbarres, twoR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, threeR, barindex+Nbarres, threeR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, FourR, barindex+Nbarres, FourR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, FiveR, barindex+Nbarres, FiveR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, SixR, barindex+Nbarres, SixR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, SevenR, barindex+Nbarres, SevenR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, EightR, barindex+Nbarres, EightR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, NineR, barindex+Nbarres, NineR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, TenR, barindex+Nbarres, TenR) coloured(0,155,0) style(dottedline,1)

      DRAWTEXT(“in”, barindex+Nbarres+1, myentry)
      DRAWTEXT(“stop”, barindex+Nbarres+1, mystop) coloured(255,0,0)
      DRAWTEXT(“1R”, barindex+Nbarres+1, oneR) coloured(0,155,0)
      DRAWTEXT(“2R”, barindex+Nbarres+1, twoR) coloured(0,155,0)
      DRAWTEXT(“3R”, barindex+Nbarres+1, threeR) coloured(0,155,0)
      DRAWTEXT(“4R”, barindex+Nbarres+1, FourR) coloured(0,155,0)
      DRAWTEXT(“5R”, barindex+Nbarres+1, FiveR) coloured(0,155,0)
      DRAWTEXT(“6R”, barindex+Nbarres+1, SixR) coloured(0,155,0)
      DRAWTEXT(“7R”, barindex+Nbarres+1, SevenR) coloured(0,155,0)
      DRAWTEXT(“8R”, barindex+Nbarres+1, EightR) coloured(0,155,0)
      DRAWTEXT(“9R”, barindex+Nbarres+1, NineR) coloured(0,155,0)
      DRAWTEXT(“10R”, barindex+Nbarres+1, TenR) coloured(0,155,0)

      endif

      return

  4. JC_Bywan • 07/20/2021 #

    Hi, here it is modified for 10R:

    defparam DRAWONLASTBARONLY=true

    LeR=myentry-mystop
    OneR=myentry+LeR
    TwoR=myentry+LeR*2
    ThreeR=myentry+LeR*3
    FourR=myentry+LeR*4
    FiveR=myentry+LeR*5
    SixR=myentry+LeR*6
    SevenR=myentry+LeR*7
    EightR=myentry+LeR*8
    NineR=myentry+LeR*9
    TenR=myentry+LeR*10

    if islastbarupdate then
    DRAWSEGMENT(barindex, myentry, barindex+Nbarres, myentry) style(dottedline,1)
    DRAWSEGMENT(barindex, mystop, barindex+Nbarres, mystop) coloured(255,0,0) style(dottedline,1)
    DRAWSEGMENT(barindex, oneR, barindex+Nbarres, oneR) coloured(0,155,0) style(dottedline,1)
    DRAWSEGMENT(barindex, twoR, barindex+Nbarres, twoR) coloured(0,155,0) style(dottedline,1)
    DRAWSEGMENT(barindex, threeR, barindex+Nbarres, threeR) coloured(0,155,0) style(dottedline,1)
    DRAWSEGMENT(barindex, FourR, barindex+Nbarres, FourR) coloured(0,155,0) style(dottedline,1)
    DRAWSEGMENT(barindex, FiveR, barindex+Nbarres, FiveR) coloured(0,155,0) style(dottedline,1)
    DRAWSEGMENT(barindex, SixR, barindex+Nbarres, SixR) coloured(0,155,0) style(dottedline,1)
    DRAWSEGMENT(barindex, SevenR, barindex+Nbarres, SevenR) coloured(0,155,0) style(dottedline,1)
    DRAWSEGMENT(barindex, EightR, barindex+Nbarres, EightR) coloured(0,155,0) style(dottedline,1)
    DRAWSEGMENT(barindex, NineR, barindex+Nbarres, NineR) coloured(0,155,0) style(dottedline,1)
    DRAWSEGMENT(barindex, TenR, barindex+Nbarres, TenR) coloured(0,155,0) style(dottedline,1)

    DRAWTEXT(“in”, barindex+Nbarres+1, myentry)
    DRAWTEXT(“stop”, barindex+Nbarres+1, mystop) coloured(255,0,0)
    DRAWTEXT(“1R”, barindex+Nbarres+1, oneR) coloured(0,155,0)
    DRAWTEXT(“2R”, barindex+Nbarres+1, twoR) coloured(0,155,0)
    DRAWTEXT(“3R”, barindex+Nbarres+1, threeR) coloured(0,155,0)
    DRAWTEXT(“4R”, barindex+Nbarres+1, FourR) coloured(0,155,0)
    DRAWTEXT(“5R”, barindex+Nbarres+1, FiveR) coloured(0,155,0)
    DRAWTEXT(“6R”, barindex+Nbarres+1, SixR) coloured(0,155,0)
    DRAWTEXT(“7R”, barindex+Nbarres+1, SevenR) coloured(0,155,0)
    DRAWTEXT(“8R”, barindex+Nbarres+1, EightR) coloured(0,155,0)
    DRAWTEXT(“9R”, barindex+Nbarres+1, NineR) coloured(0,155,0)
    DRAWTEXT(“10R”, barindex+Nbarres+1, TenR) coloured(0,155,0)

    endif

    return

  5. jonpt88 • 07/20/2021 #

    Thank you so much :). In the beginning I thought I cannot see the 10x return haha it is much lower in the daily chart. The CODE is now perfect – thank you again.

  6. jonpt88 • 07/20/2021 #

    Hello everyone – can anyone be so kind to add to the 10R modification the 0.50R (before the 1R logically). Thank you so much.

    • JC_Bywan • 07/20/2021 #

      Hi, with added 0.5R, happy new year:

      defparam DRAWONLASTBARONLY=true

      LeR=myentry-mystop

      HalfR=myentry+LeR/2

      OneR=myentry+LeR
      TwoR=myentry+LeR*2
      ThreeR=myentry+LeR*3
      FourR=myentry+LeR*4
      FiveR=myentry+LeR*5
      SixR=myentry+LeR*6
      SevenR=myentry+LeR*7
      EightR=myentry+LeR*8
      NineR=myentry+LeR*9
      TenR=myentry+LeR*10

      if islastbarupdate then
      DRAWSEGMENT(barindex, myentry, barindex+Nbarres, myentry) style(dottedline,1)
      DRAWSEGMENT(barindex, mystop, barindex+Nbarres, mystop) coloured(255,0,0) style(dottedline,1)
      DRAWSEGMENT(barindex, HalfR, barindex+Nbarres, HalfR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, oneR, barindex+Nbarres, oneR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, twoR, barindex+Nbarres, twoR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, threeR, barindex+Nbarres, threeR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, FourR, barindex+Nbarres, FourR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, FiveR, barindex+Nbarres, FiveR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, SixR, barindex+Nbarres, SixR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, SevenR, barindex+Nbarres, SevenR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, EightR, barindex+Nbarres, EightR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, NineR, barindex+Nbarres, NineR) coloured(0,155,0) style(dottedline,1)
      DRAWSEGMENT(barindex, TenR, barindex+Nbarres, TenR) coloured(0,155,0) style(dottedline,1)

      DRAWTEXT(“in”, barindex+Nbarres+1, myentry)
      DRAWTEXT(“stop”, barindex+Nbarres+1, mystop) coloured(255,0,0)
      DRAWTEXT(“0.5R”, barindex+Nbarres+1, HalfR) coloured(0,155,0)
      DRAWTEXT(“1R”, barindex+Nbarres+1, oneR) coloured(0,155,0)
      DRAWTEXT(“2R”, barindex+Nbarres+1, twoR) coloured(0,155,0)
      DRAWTEXT(“3R”, barindex+Nbarres+1, threeR) coloured(0,155,0)
      DRAWTEXT(“4R”, barindex+Nbarres+1, FourR) coloured(0,155,0)
      DRAWTEXT(“5R”, barindex+Nbarres+1, FiveR) coloured(0,155,0)
      DRAWTEXT(“6R”, barindex+Nbarres+1, SixR) coloured(0,155,0)
      DRAWTEXT(“7R”, barindex+Nbarres+1, SevenR) coloured(0,155,0)
      DRAWTEXT(“8R”, barindex+Nbarres+1, EightR) coloured(0,155,0)
      DRAWTEXT(“9R”, barindex+Nbarres+1, NineR) coloured(0,155,0)
      DRAWTEXT(“10R”, barindex+Nbarres+1, TenR) coloured(0,155,0)

      endif

      return

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Iván
2 days ago
atlante buenas tardes pero es un sistema que repinta por que pasa eso si repinta no sirve.gracias d...
Iván
2 weeks ago
Madrosat Bonjour ivan Quelle différence il y a t il entre Extra trend et ultra trend lequel est le p...
P. Marlowe Muy bueno. ¿Podría hacerse para señalar extremos por el lado bajista? Lo mismo a la inversa....
Miro Esta es una versión del indicador, para ambos extremos. //-------------------------------...
P. Marlowe Muchas gracias ¡¡
Iván Hi. You could add these lines of code: if intradaybarindex=0 then varhigh=round((dhigh(...
RTR Edit
@toniyecla ¡gracias! más capturas aqui: https://www.prorealcode.com/wp-content/uploads/2024/10/IC...
robert123 I had a go at the 'order block' version- badly done I'm sure....but a start. // Sonarlabs ...
robert123 take ''sens1 = 5'' out and put ''rango'' in as variable
@toniyecla captura: https://www.prorealcode.com/wp-content/uploads/2024/10/sesiones_v3.png
@toniyecla y más opciones: añade una línea también en sesiones EUROPA y USA (configurable) y un texto o...
@toniyecla // Author: toniyecla - contact@rescommunesomnium.com // VARIABLES // EspHorarioVerano (b...
Alai-n Hello, take a look at this formulation made by "Blade106", Topic link attached post #227334....
@toniyecla ¡interesante acercamiento! (no lo conocía, simplemente tuve la necesidad y lo programé) pers...
Iván
1 month ago
MaoRai54 dear Ivan, it seems to be very interesting but please clarify what are all the lines I see i...
Iván Hi! you have the answer in the last line of code... MacdMiddle as "histo" style(histogra...
kats Le Top , a utiliser avec le nuage violet et alerte TN pour plus de précision.
roccafragius Hello Ivan, another great Indicator, very useful to trace the trend ( blue line) and the pos...
roccafragius Hello Ivan, very good job! May I ask you to translate teh script from TradingView named Tre...
Iván Hi! yes. You can ask for it here: https://www.prorealcode.com/free-code-conversion/
roccafragius Thank you so much Ivan! I created this request in english Translate from TradingView Indicat...
Regisnew très bel indicateur merci
jordan //---settings MAmode=0 Period=150 NumberOfMA=100 //---end of settings MA2=undefined ...
jordan dites moi si cela correspond à ce que vous cherchez
kats bonjour merci de ta reponse mais non ca fonctionne pas sympa quand même d'avoir essayé cdlt
Jean2139 Bonjour Yvan, Merci pour ton indicateur que je trouve très intéressant. Je suppose que tu ...
Suffi Hier eine kleine Korrektur: //-----Inputs-----------------------------------------// MALengt...
adeelq79 Hi Ivan, thank you for this indicator. Is it possible to include the volume of buys and sell...
achel J'ai la même erreur sur ligne 1 avec une importation dans les règles de l'art. Comment faire?
Iván Cela est probablement dû au fait que vous avez une ancienne version de l'outillage. Vérifi...
Iván
4 months ago
Iván Hola javier gracias! es importante realizar buenos backtest antes de lanzarse al mercado y ...
achel I have an error with "fillcolor" - How to solve this? / J'ai une erreur avec "fillcolor" - C...
Iván Hi! This is because you are not with V12. Just delete fillcolor

Top