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

Bar Goes splat! - Strategy fix

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

    Bar Goes splat! - Strategy fix

    Hi,

    I have a strategy that i am working on and for the most part it works great, but i noticed I am unable to figure out how to code properly for when a bar goes splat or in a short position goes to the moon. Take a look at the attachment. It's a 5 minute candle bar that just went down about 30 points in 5 minutes.

    I want to code something, but not sure exactly how to prevent it from taking a huge loss . I don't want to wait till bar closes to get me out at a huge loss. i would rather take a loss after 5-6 points than 30 in the same bar.
    Attached Files

    #2
    Hello priceisking,

    If this real-time, you can use a stoploss (SetStopLoss()) with a preset distance from the entry price.
    This would fill in real-time before the trade has closed.
    (Historically, SetStopLoss() would fill when the primary bar closes)

    Below is a public link to the help guide on SetStopLoss().


    If this is historical, you would need intra-bar granularity to trigger intra-bar actions.
    Below is a link to a forum post where I detail intra-bar granularity.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Do you have any video links to coding trailing stops?

      Comment


        #4
        Hello priceisking,

        Thank you for your response.

        We would not have any videos specific to trailing stops in NinjaScript. Can you detail what kind of trailing stop you would like to build?

        I look forward to assisting you further.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,611 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        9 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        19 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        6 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        22 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X