Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetStopLoss is triggered incorrectly!

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

    SetStopLoss is triggered incorrectly!

    Hi,

    I am using a stop loss method:
    SetStopLoss("EnterShortLimit_Mid-BB0", CalculationMode.Ticks, stopTarget, true);

    It works perfectly unless I enter, for example, a short trade at 1.1477 and the open of that bar(time frame) is greater then 80 pips.

    Attached is an image showing a 30 min time frame with an 80 pips SetStopLoss. I go in at 1.1477 and the opening of that bar is 1.1561, which is 1.1477 - 1.1561 = -84pips. But you can see the other bet in the same bar goes in at 1.1500 and the stop loss is not triggered...

    What am I missing? I know that the trade did not go out properly because that would mean the price would have had to dropped to 1.1477 and then go back up to 1.1561 and then all the way down to close all in 30min. And this would have happened twice in a row because the bar before the above trade has the same issue.

    I am using two timeframes, a 30 min which is what you see in the cart and a 1 min timeframe that I use for my entryOrders. So where does that leave my SetStopLoss orders in regards to time, ticks I believe...? I have placed my SetStopLoss' inside of the Initialize() method and inside of both 30 and 1 min time frame but I always get the same result.

    Thanks for thoughts!!
    4D
    Attached Files

    #2
    Hello,

    thank you for the question.

    I am unsure based on the image and description with what is happening. Have you started any type of debugging on this item?

    Being that it seems there is a specific value you can use to cause this, you may be able to narrow down what is happening in the code by using Print statements.

    If you are unable to locate the problem in the logic you could also post a very simplified example of the logic being used for the entry and stop so we could see if anything else sticks out that may be the cause.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    141 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    80 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    123 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    118 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Working...
    X