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

Stop price can't be changed below the market

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

    Stop price can't be changed below the market

    Hi,
    In the last few days I sometimes get the following error: "Stop price can't be changed below the market".
    I get the fact that the stop loss price must be below the current market price but I set a trailing stop using the managed approach.
    This is the code that sets the new trailing stop loss:
    SetTrailStop(signalName, CalculationMode.Ticks, newTrailingStop, false);

    I logged the newTrailingStopLoss and it's a positive number so that's not the problem.
    I just don't understand how is it that if I tell ninja to set the stop loss in ticks and in my case it's 13, how is it possible that I'm getting this error message?
    I hope not but I think it's a bug in the platform...
    I would really appreciate any help resolving this problem, thanks in advance

    #2
    Hi weedjitsu, thanks for your post.

    Do you have a test script that I can try? You may send it to platformsupport at ninjatrader.com and reference "ATTN ChrisL 2351606" in the body of the email or post the script here.

    I look forward to hearing from you.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChrisL View Post
      Hi weedjitsu, thanks for your post.

      Do you have a test script that I can try? You may send it to platformsupport at ninjatrader.com and reference "ATTN ChrisL 2351606" in the body of the email or post the script here.

      I look forward to hearing from you.
      Not right now but I'll write something and post it here

      Comment


        #4
        I sent the test script to the platfrom support email because it's more convenient...
        After we figure out the problem I'm going to post the solution here in case someone will have this issue too

        Comment


          #5
          Hello weedjitsu,

          Thank you for your response.

          I was unable to find your ticket in our support queue. However, I believe a simple solution is possible here.

          When the SetStopLoss() is used are you dynamically changing/setting the newTrailingStop during run-time in OnBarUpdate()?

          If so, you will need to reset your SetStopLoss() when the strategy position is flat to avoid the old price level being used. You can find an example of resetting the SetStopLoss() when flat at the following link: https://ninjatrader.com/support/help...of_stop_lo.htm

          If this is not the case please make sure to reference this thread link in your email to platformsupport[at]ninjatrader[dot]com.We look forward to being of further assistance.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by sephichapdson, Today, 11:36 PM
          0 responses
          1 view
          0 likes
          Last Post sephichapdson  
          Started by bortz, 11-06-2023, 08:04 AM
          47 responses
          1,612 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
           
          Working...
          X