Risk/Reward Tool showing R multiples

Category: Indicators By: JC_Bywan Created: July 20, 2021, 5:56 PM
July 20, 2021, 5:56 PM
Indicators
8 Comments

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)

// 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

Download
Filename: PRC_Custom_R_tool.itf
Downloads: 265
JC_Bywan Master
https://market.prorealcode.com/store/volume-profile-solutions/ - Trading since 2008, using PRT since 2009, PRC forums moderator since 2016, helping out when I can. Using personal algorithmic universal market model (any market, any timeframe, self-adaptating no optimisation required), and volume profile and tape personal tools. Scientific coding skills from past life in aerospace sector, in Computational Fluid Dynamics.
Author’s Profile

Comments

Logo Logo
Loading...