Risk/Reward Tool showing R multiples

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #173177 quote
    Zac
    Participant
    Average

    Hi,

    I’ve been looking for a risk/reward tool in PRT, and the search function sent me here.

    I’m looking to mark the entry price and stop loss and see where 1R, 2R, 3R, etc., fall on the chart.  Does anyone know whether something like that exists? I’d rather not reconfigure the Fib tool if I can avoid it.

    #173305 quote
    Maverick
    Moderator
    Average

    Dear Zac,

     

    Following your request, please note that such a risk/reward tool does not exist yet, but this is a good suggestion.

    We already had this suggestion and we are taking it into account for our future improvements.

    Meanwhile, i invite you to you ask the ProRealCode community if there is a way to code an index in this sense.

     

    Regards,

     

    Victor from ProRealTime.

    Zac thanked this post
    #173316 quote
    JC_Bywan
    Moderator
    Master

    Hi, here’s a probuilder personal indicator to add to the price window, you just need to create the 3 entry parameters myentry, mystop, Nbarres respectively your expected entry level, your expected stop and the number of bars to the right to draw the levels and text. Then you can just change them from the indicator properties window. It works for both long and short, as long as stop is positionned accordingly compared with entry, it will automatically place 1R,2R,3R in the right direction. Any request to modify, please ask I’ll see what more I can do:

    //PRC_Custom_R_tool | indicator
    //07.07.2021
    //Noobywan @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //
    
    // List of Parameters to create, with default values suiting your favorite asset, to configure in the properties window:
    // myentry, type decimal
    // mystop, type decimal
    // Nbarres, type integer
    
    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
    Zac, Nicolas and PLermite thanked this post
    PRC_Custom_R_tool2021-07-07.png PRC_Custom_R_tool2021-07-07.png PRC_Custom_R_tool_2_2021-07-07.png PRC_Custom_R_tool_2_2021-07-07.png
    #173397 quote
    Zac
    Participant
    Average

    Thank you for the code. It is much appreciated. The screenshot appears to be exactly what I have been looking for.

    #173554 quote
    Roberto S.
    Participant
    Average

    I am using an updated version of the Fibonacci tool.
    Basically, I configured that tool to show lines at 0 (entry point) and 100 (stop loss). Then, I show -100 (R1), -200 (R2) and so on…
    I am not the smart man… I am pretty sure I copied it from someone else here in this forum, but I don’t have the original post (sorry).

    In attachment a screenshot of the configuration.

    In order to use it, for example in a long setup, you have to start from the SL and define the entry point (at least one day after otherwise it doesn’t work).

    Zac thanked this post
    screenshot_2021-07-13.png screenshot_2021-07-13.png
    #173865 quote
    Zac
    Participant
    Average

    I appreciate the time you took to create/share the code. Unfortunately, I am unable to get it working on FX.

    Have I made an error?  The values are based on EURUSD D1 chart today (July 20th).

    //PRC_Custom_R_tool | indicator
    //07.07.2021
    //Noobywan @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //
     
    // List of Parameters to create, with default values suiting your favorite asset, to configure in the properties window:
    myentry=11830.5
    mystop=11750.0
    Nbarres=15
     
    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

    I have also attached a screenshot of the error message.

    [attachment file=”173866″]

    PRT-Error.png PRT-Error.png
    #173871 quote
    robertogozzi
    Moderator
    Master

    DEFPARAM should be line 1, not 12.
    Move it to the first line after the comments.

    JC_Bywan and Zac thanked this post
    #173908 quote
    JC_Bywan
    Moderator
    Master

    Thanks Roberto, hi Zac, the code is now in the library, you may prefer to download it from there, it will have the parameters defined in the properties window, and rather than having to type them in the code listing you can change them from the indicator properties window:

    Risk/Reward Tool showing R multiples

    Zac thanked this post
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Risk/Reward Tool showing R multiples


Platform Support: Charts, Data & Broker Setup

New Reply
Author
author-avatar
Zac @zac Participant
Summary

This topic contains 7 replies,
has 5 voices, and was last updated by JC_Bywan
4 years, 7 months ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 07/05/2021
Status: Active
Attachments: 4 files
Logo Logo
Loading...