• 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

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.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Kabua, Yesterday, 11:24 PM
    1 response
    6 views
    0 likes
    Last Post koganam
    by koganam
     
    Started by KandI, Today, 08:03 AM
    2 responses
    7 views
    0 likes
    Last Post KandI
    by KandI
     
    Started by kujista, Yesterday, 10:33 PM
    4 responses
    13 views
    0 likes
    Last Post kujista
    by kujista
     
    Started by tonynt, Today, 07:27 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Started by brownsfan019, Today, 07:23 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Working...
    X