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

SetStopLoss in the middle of the current bar

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

    SetStopLoss in the middle of the current bar

    Hi all,

    The open, high, low, close of the 1-hour bar I am referring to is as following
    open - 109.14'4
    high - 109.25'4
    low - 109.14'0
    close - 109.23'7

    prior to entering the long position, I set the stop at 109.14'1 (one tick above the low of the bar)
    I entered the long position at 109.19'9

    It looks like once I enter the position, the stop triggered. When to look at the minute bar, I see that the position was entered at 109.19'9, and the price never went to 109.14'1 after the position is entered, so I must be doing something wrong when setting the stop loss. How can I set a stoploss when the stoploss price is in the middle of the bar where I entered a position?

    Thank you,

    #2
    Hello op1031,

    The stop should be set to the price value you have submitted to the method at the time it is submitted.

    Are you using Print to print the values being submitted to the method along with the time of the bar?

    Is TraceOrders enabled to see if the orders are being ignored?

    Below is a link to a forum post that demonstrates using prints to understand behavior.


    Please save the output from the output window to a text file and include this with your reply.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      The print statement shows the currentbid price one pip below the stop, so the stop was hit. However, the minute bar shows once the entry price was hit, the minute bar never went back to the stop price, so in reality, the trade would not have been stopped out at the same candle as the entry.

      I am thinking this is a popular issue around here, so what's the correct way to deal with this?

      Thank you,

      Comment


        #4
        Hello op1031,

        Is this historical or real-time?

        If historical, is 1 tick intra-bar granularity implemented for price and time accuracy with order fills?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by algospoke, Yesterday, 06:40 PM
        2 responses
        24 views
        0 likes
        Last Post algospoke  
        Started by ghoul, Today, 06:02 PM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        46 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        23 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        181 views
        0 likes
        Last Post jeronymite  
        Working...
        X