• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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().
    https://ninjatrader.com/support/help...etstoploss.htm

    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.
    https://ninjatrader.com/support/foru...297#post491297
    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.
        Patrick H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Longhornmark, Today, 08:25 AM
        3 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by mohdhm, Today, 04:09 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ShawnB  
        Started by BGWTEX, Today, 03:30 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by marekflys, Today, 03:07 PM
        0 responses
        10 views
        0 likes
        Last Post marekflys  
        Started by GregoryBaskin, Today, 02:51 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Tyler  
        Working...
        X