Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Drawing the Stop Price on the Chart

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

    Drawing the Stop Price on the Chart

    How can we draw a curve on the chart which show the value of the Trail Stop for each bar when there is an order active?

    I have tried many difference things but nothing works.

    I have managed to draw huge ugly dots on the chart at any location, but I cannot capture the value of the Trail Stop as it changes and I cannot draw a line on a chart.

    Is there an example of this in the NT help guide somewhere? The same would be useful for the Profit Target.
    Attached Files
    Last edited by AlgoJason; 02-12-2018, 07:18 PM. Reason: Add example

    #2
    Hello,

    Thank you for the post.

    To capture the trail stop, you could use the OnOrderUpdate override you have in the script currently. In nearly the same way that you are checking for the entry, you can look for the trailing stop.

    I don't see that you currently have a trailing stop order in the script so you would need to add that first so OnOrderUpdate is called for the trailstop.

    Once you have a trailstop, you can draw the dot where you set the stop price, or look for an order with the trailstops name, you can see its name by Printing the order object or by looking in the orders tab.

    For each of the order changes the trailstop has, the dot could be updated/added from OnOrderUpdate.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bmartz, 03-12-2024, 06:12 AM
    4 responses
    32 views
    0 likes
    Last Post bmartz
    by bmartz
     
    Started by Aviram Y, Today, 05:29 AM
    4 responses
    12 views
    0 likes
    Last Post Aviram Y  
    Started by algospoke, 04-17-2024, 06:40 PM
    3 responses
    28 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by gentlebenthebear, Today, 01:30 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by cls71, Today, 04:45 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X