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)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
// PRC_Custom_R_tool | indicator // 07.07.2021 // Noobywan @ www.prorealcode.com // Sharing ProRealTime knowledge // PRC marketplace store: // https://market.prorealcode.com/store/volume-profile-solutions/ // List of Parameters to configure in the properties window: // myentry, type decimal, your entry level // mystop, type decimal, your stop level // Nbarres, type integer, number of bars to the right for segments and text defparam DRAWONLASTBARONLY=true LeR=myentry-mystop OneR=myentry+LeR TwoR=myentry+LeR*2 ThreeR=myentry+LeR*3 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) 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) endif return |
Share this
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 :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
it helps thanks
Very useful. Thank you!
Could someone kindly modify the code until 10R? Would that be possible…
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
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
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.
Hello everyone – can anyone be so kind to add to the 10R modification the 0.50R (before the 1R logically). Thank you so much.
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