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 Haiasi, 04-25-2024, 06:53 PM
    4 responses
    55 views
    0 likes
    Last Post effraenk  
    Started by ccbiasi, 11-23-2017, 06:06 AM
    5 responses
    2,199 views
    0 likes
    Last Post leodavis  
    Started by kujista, Yesterday, 12:39 AM
    2 responses
    14 views
    0 likes
    Last Post kujista
    by kujista
     
    Started by Austiner87, Yesterday, 11:24 AM
    2 responses
    12 views
    0 likes
    Last Post brucerobinson  
    Started by Rogers101, 05-05-2024, 11:30 AM
    3 responses
    21 views
    0 likes
    Last Post Rogers101  
    Working...
    X