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

Stopmove

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

    Stopmove

    Hello,

    I want to ask please about modifying stoplosses in script strategy. I want to have stop always below low of min of last 3 bars (for long) and above high of max of last 3 bars (for short). I run it in a range chart and it is working ok but I see stoploss "jumping" with every new bar, even when its on the same price. How can I avoid this please, so that its only set new with a new price and not with every bar.

    Thank you!
    Tony

    #2
    Hello Tony,

    With the "jumping" are you seeing change order states on the Log tab of the Control Center when this occurs?

    Likely, the logic in the script is calling SetStopLoss() with different prices.

    If you would like assistance analyzing output to understand the behavior, enable TraceOrders, print the order object in OnOrderUpdate(), save the output to a text file, and include this with your next post.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,

      I need lot of time to understanding trace orders, prints.... so I resolved it with adding a bool to compare stopvalues. Whatever will be the recognition of the trace and prints I´d have to change something then...

      Thank you for your support!
      Tony.

      Comment


        #4
        Hello again....

        I´m testing scripts moving stops with parabolic or hma or "basic" trailingstop.... and what I´m experiencing is that it occurs that I get often error messages and scripts are closed (please see attached screenshot, this is from a "normal" trailingstop without any calculation from me). Once this occurs one does not know 100% what is the situation with the position and the orders on the exchange. How can this be avoided please?

        Thank you!
        Tony
        Attached Files
        Last edited by tonynt; 03-28-2023, 01:41 PM. Reason: translation error

        Comment


          #5
          Hello Tony,

          The error is an unable to change order error that likely came from the brokerage.

          This could be due to the order change request being too far from the market price, or outside of market hours.

          The order error on the Log tab of the Control Center may have more information.

          Have you contacted your broker to inquire why the change request was unsuccessful?
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hello,

            brokerage is NT-continuum. Right now it occurred at 14:20 EST and not too far from market price or outside of market hours.

            I attach the screenshot from Logtab and a screenshot of the chart, it was a short trade, so the setstoploss should be modified with a downbar(?)

            Once trade is certain ticks in profit I reduce the settrailstop to 5 ticks (because I want to use it instead of a target).

            It seems from the message in log-tab that in this short trade price got up fast so that the 5 tick stop would have been below

            OK, but what I do not understand is the story: it seems that the settrailstop was changed in the green upbar after the ellipse so that price got over the 32789 (blue horizontal line) before it could be changed. But when it is an 8 Range chart why isnt setstoploss with 5 ticks moved with the downbar in the ellipse - and if so then this issue wouldnt occur. (this is what I thought would avoid the problem when ticks for trailstop < than rangesize of the bar).

            What is not logical there so that this issue occurs please?

            Thank you!
            Tony
            Attached Files
            Last edited by tonynt; 03-29-2023, 01:17 PM. Reason: add info

            Comment


              #7
              Hello Tony,

              I'm not sure I am understanding.

              If the stop price is a valid price the order will not be rejected.
              Hi I have a sellshort StopLimit order that i change if unfilled. I tick below the last bar's low. I keep getting the stop price can't be changed above the market but the price value it quotes ( the one I want) is below the market. Currently I am on the simulated feed. I appreciate in real market situations this could happen


              I would need output from TraceOrders and prints to assist you in understanding the behavior.
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by AttiM, 02-14-2024, 05:20 PM
              12 responses
              211 views
              0 likes
              Last Post DrakeiJosh  
              Started by cre8able, 02-11-2023, 05:43 PM
              3 responses
              236 views
              0 likes
              Last Post rhubear
              by rhubear
               
              Started by frslvr, 04-11-2024, 07:26 AM
              8 responses
              114 views
              1 like
              Last Post NinjaTrader_BrandonH  
              Started by stafe, 04-15-2024, 08:34 PM
              10 responses
              47 views
              0 likes
              Last Post stafe
              by stafe
               
              Started by rocketman7, Today, 09:41 AM
              3 responses
              11 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X