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
jacquesgermain Bonjour non pas de soucis car src=customclose donc dans le menu configuration/propriété me...
geroniman Merci Jacques , indic tres utile. J'ai un indic à programmer avec du price action. es tu dis...
jacquesgermain ok pour regarder ...
Bateson
5 months ago
Bateson
5 months ago
Quino
5 months ago
Bateson
6 months ago
MACD Reloaded
MACD Reloaded
2
Indicators
NEOMKEY Nada nuevo
Carlose I love your version of the MACD, if you use it you can get a lot of use out of it, for me ma...
Bateson
6 months ago
TSI 3.0
TSI 3.0
6
Indicators
Fgats a = (Average[l1,m1](Average[l2,m2](ROC[mfvalue](close)))) b = (Average[l3,m3](Average[l4,m4...
Bateson Fgats, Un grand merci. Cela fonctionne parfaitement. J'ai bien compris la partie à rajouter ...
Fgats
6 months ago
bousalahane hello, thank you for sharing, I’m not top strong in the programation part, there is a way to...
Fgats Hi, With this indicator I just wanted to show the interest that can exist to synthesize th...
davidguerreir how to adapt nbStdSig values ?
lkiklkik thanks a lot. description of the indicator seems wrong ...
robertogozzi Sorry, you're right. The correct description, from https://www.tradingview.com/script/omlpq...
carlvan Hi Nicolas, thank you for this very interesting code. There is something I don't get though ...
Atemi19 probleme code : message veuillez definir alpha futur nbO X X1Y y1
Xtian Bjr Nicolas , pour exemple cet indicateur est extrêmement bien développé chez trading view ...
Actaru5 Hi, I couldn't see the candles well. Changing the code solves the problem. from line 164 to...
LucasBest Thank you
Alai-n @LucasBest Hello, do you think it is possible to isolate moving averages? I would like to us...
Alai-n I really like it when you develop ideas around price movement! I am much less a fan of all t...
finplus Bonjour, une petite demande concernant cet indicateur : comment faire pour que lorsque la bo...
LucasBest Bonjour, la coloration des bandes se fait ligne 111 et 112 à l'aide des instructions colorbe...
Matriciel Very nice job ! Is it possible to do the opposite because what interests me is to have the ...
YvesRobert Hi Matriciel, how can we do this, because stochastic is limited between 0 and 100 but price ...
Traderfox06 Dear zeiiermantrading, I really like your approach combining adaptive averages with MACD in...

Top