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
roccafragius Hello Ivan, thanks a lot for all these beautiful and useful indicator!! Great Job!!
Iván Thanks ;)
Gaspare Ciao Ivan si puo' inserire una strategia su questo indicatore per ottimizzare le variabil...
P. Marlowe Impressive work. Accurate, interesting, good background. You hit the nail on the head again....
Iván Hi! You should change $rbox, $gbox and $bbox variables. Also r,g,b for last box.
finplus Thanks Ivan.
roccafragius Ivan, I just want to say you.. very very great job!!!! Thank you so much for this indicator!...
Iván
2 weeks ago
groelandes Cuando te descargas el fichero itf, en su código no aparece toda la configuración de alertas...
Iván Si lo descargas e importas en tu PRT verás que se han creado las variables para luego config...
Iván
2 weeks ago
Danger Zones Indicator
Danger Zones Indicator
2
Indicators
P. Marlowe Quite an impressive work, as usual. You share extremely useful tools and show an stunning ba...
Iván Thank you very much!
P. Marlowe Quite an impressive work, Iván. Extremely useful and accurate. Congratulations. Keep it up¡
lkiklkik i love it !!! thanks.
Stenozar Hi Ivan, can you translate from tradingviwe the EMA TREND METER INDICATOR? It couid be inte...
Iván Hi Yes I can. Please, create a new topic for that I will translate it.
Stenozar Hi Ivan, I've created a new topic about the indicator: https://www.prorealcode.com/topic/ema...
Iván sería así //------------------Inputs------------------------------ linreglength = 11//i...
Doddge Muchísimas gracias Iván, está genial.
superfalcio holaaa, have you run some statistics?
Doddge Hola Iván, ¿sería posible crear un screener que indique cuándo las velas coloreadas del indi...
RTR Ivan thank you for the pro-screener. I a trying to understand how to write the signals from ...
Iván Hi, Lines 62 and 63. These lines define buy and sell conditions.
el titi Bonjour, merci beaucoup pour ce partage. Je vais regarder avec attention ce script et analys...
Armand2020 Bonjour , super taf!! serait il possible de faire un poc dynamique en timeframe 5 min en mod...
philippe59139 voici ce qu'il faudrait faire ou ajouter: //poc dynamique defparam calculateonlastbars=1...
Iván
2 months ago
Iván I personally like it in daily timeframe
oliTR Many thanks Ivan, I copy/paste your code to try it but could only get a constant stable unif...
Iván Hi, I've copied the code above and it works... what asset are you trying? $indices array ...
francis59 Hello Ivan, thanks for this very nice and powerfull indicator. Could you have time to create...
Iván Hi We could find stocks with sweep on: //PRC_Sweep Institucional //version = 0 //28.0...
inverse Like the way you think Ivan ... :)
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
Gio56 Super idée. j'ai juste un souci. j'ai pas de barre verte mais plusieurs lignes de couleurs.....
DeathMetal change line in histgram, (click on indicator name, click on tool (
Gio56 Super merci.
Ciccarelli Franco Sembra molto interessante e volevo dei chiarimenti se possibile :Le righe commentate vanno l...
KumoNoJuzza Thank you @philippe59139 !! We finally have the VAL / VAH to play with. Could you attach th...

Top