Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Submitting stoploss order how to set parameter Stops&Targetsubmission

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

    Submitting stoploss order how to set parameter Stops&Targetsubmission

    Hi,

    Programming a strategy that is having a delayed stoploss based on the value of an index rather than the future, this stoplossorder may or may not be executed. After a certain MFE I exit 1 contract and set the remaining contracts to BE. If I do that when I entered Stops&Targetsubmission by StrategyPosition than it works ok, but when the Stops&Targetsubmission is not set to StrategyPosition I see that the order is for all contract rather than the remaining.

    Can I set the parameter Stops&Targetsubmission within my strategy or should I switch my statements to change the stoploss first and then exit 1?

    #2
    clint2008,

    I guess I am confused as to what you are trying. Are you talking about an ATM strategy or a NinjaScript strategy?

    If you are from a NinjaScript strategy, in order for you to scale-out like that you need to scale-in with multiple entries first.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply. I'm working on Ninjascript Strategy.
      So what I want to do is:
      EnterLong quantity 2 (no stoploss / no profittarget / no trailstop)
      after 40 ticks of profit -> ExitLong quantity 1 and SetStopLoss = Position.AvgPrice

      This SetStopLoss is now entered for quantity 2 in stead of 1 (the actual position)

      When I change Stops&TargetSubmission to By Strategy position the SetStopLoss is done for quantity 1; that is good.

      Now how can I set this parameter within my NinjaScript to make sure it is defaulted correct?

      Comment


        #4
        Unfortunately this is not supported.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I've tested a few things:

          1) Rewrite of my script to enter unique entries -> that is working fine (scale in / scale out) however after all positions are closed (in the orders/excutions/positions tab) the strategyscript is still saying Position.Quantity = 1 and MarketPostion is not flat. That is unacceptable also.

          2) I switched the ExitLong / SetStoploss statements to SetStoploss / Exitlong, so that the position was still at 2 when I changed the stoploss and then exit 1. But no difference, still ending up 1 position at the wrong side. Lots of orders after stop is hit.

          So the only way it works absolute correct is the parameter Stop & Targetsubmission by Strategyposition. You say that that is not supported.
          Is the usage of the parameter not supported or is changing the parameter from ninjascript not supported?

          I would really want some help if possible, I'm writing the script and a number of people have already told that they would love to use it when its ready.

          Scaling out a position is something everyone wants isn't it, so nothing strange there.

          But I only want to use supported options.

          Comment


            #6
            1. You need to debug your code and figure out why it is still open.

            2. You are likely running into many Internal Order Handling Rules with your mixing of explicit exits and SetStopLoss. You need to be careful when you code this. Please review the rules at the bottom of this article and use TraceOrders = true to evaluate your code. http://www.ninjatrader-support.com/H...verview36.html

            Usage of a parameter is not supported.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            77 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            45 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            27 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            32 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            62 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X