Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modifying Risk - Reward Drawing Tool in NT8

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Modifying Risk - Reward Drawing Tool in NT8

    Hi All,

    I'd like to create a tool (or modify the native version) similar to the "Risk - Reward" drawing tool.

    Rather than set the R:R (I know you can change the R:R value in "properties") and have the tool set the target based on the entry and stop, I need to be able to move the target line on the chart and show the new R:R somewhere on the chart.

    Of course, currently, if you move the target, the stop is adjusted to maintain the predefined R:R. I need it to be dynamic based on the movement of any of the three data points (ent, stp, tgt).

    Any help with this would be appreciated! Chat GPT worked for one indicator then someone caught on and limited it's capabilities!

    #2
    Hello JamesEM,

    If you want to manually move the line you would have to add mouse handing for that in a new tool, unfortunately that is fairly complicated and not something I could just detail how to exactly do that. It would require modifications and testing to make that change. If you wanted to do that you can make a copy of the original tool and then edit its code to be how you wanted it to work.

    In regard to AI tools we recommend avoiding those for now as they often provide invalid code or suggestions, I have included a disclaimer about that below.

    From our experience at this time, ChatGpt and other AI models are not adequate at generating valid NinjaScript code that function as the user has intentioned. We often find that these tools generate code that will call non-existent properties and methods, use improper classes or inheritance, and may have incorrect logic. In addition any code that does compile may not work efficiently or correctly based on the NinjaScript coding guidelines. Using these tools for general NinjaScript learning information may also provide incorrect responses. We highly encourage that you create a new NinjaScript yourself using the NinjaScript Editor and avoid any AI based coding tools.

    While it would not be within our support model to assist with scripts generated or checked by ai tools, we would be happy to provide insight for any direct specific inquiries you may have if you would like to create this script yourself. Our support is able to assist with finding resources in our help guide as well as simple examples, and we are happy to provide guidance on how you can debug the script while running it on your machine. To start learning NinjaScript I would suggest the following link as a starting point.


    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.​

    Comment


      #3
      Hey there Jesse - Thanks for the quick response.

      "If you wanted to do that you can make a copy of the original tool and then edit its code to be how you wanted it to work."

      Could you tell me how to do this? Then I can try to figure it out as I go.

      "...and not something I could just detail how to exactly do that"

      Maybe if you give me a brief overview of what I need to look at? Then, as I said, I can figure out the details with some modifications and testing.

      Thanks in advance for any additional help.


      James

      Comment


        #4
        Hello JamesEM,

        To make copies of existing items you can open them in the editor -> right click -> Save as. That will create a copy of the script hat you can edit.

        Drawing tools are fairly complex coding tasks so there is not one specific area that I could detail. you will need to go through the mouse handling logic for the anchors if you want to change the anchors/mouse portion at all. The other part would be OnRender, that is where the lines are drawn to the screen. If you want to change how its drawing that would be the section to go through.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        547 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        323 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        99 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        543 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        545 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X