Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get Prevailing Stop Prices for SetTrailStop()

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

    Get Prevailing Stop Prices for SetTrailStop()

    Is there a way for me to GET the prevailing stop price used by the SetTrailStop method such that I can track the value at the close of each bar for debugging purposes? I am setting an initial trailing stop using CalculationMode.Ticks in Initialize() and when Flat but when in an open position, will reduce the amount of the trailing stop within OnBarUpdate() when a certain profit objective is met. It does not appear that the subsequent ratcheted trailing stop is working correctly. Thanks.

    Whitmark
    whitmark
    NinjaTrader Ecosystem Vendor - Whitmark Development

    #2
    Unfortunately not at this time. Possibly in the fall since we are introducing some new concepts that allow you to get back order information.
    RayNinjaTrader Customer Service

    Comment


      #3
      The help on SetTrailStop() states:

      You may call this method from within the strategy OnBarUpdate() method should you wish to dynamically change the trail stop price while in an open position
      Is there an open issue with using SetTrailStop() dynamically for an open position in the manner I descibed earlier? For this to work dynamically, is it required that I supply all the parameters especially the fromEntrySignal? Do I need to restate the command on each bar?
      SetTrailStop(string fromEntrySignal, CalculationMode mode, double value, bool simulated)

      If there is an issue, is there a recommended work around?

      Also, in this context, CalculationModes of "Percent" and "Ticks" make sense as a trailing stop offset, but how is the mode "Price" used?

      Thanks,

      Whitmark
      Last edited by whitmark; 06-16-2007, 11:33 AM.
      whitmark
      NinjaTrader Ecosystem Vendor - Whitmark Development

      Comment


        #4
        All parameters are required and the method only needs to be called once, not each bar. Price is used as an absolute value. If you passed in "2" and you were trading MSFT, that would be $2 offset which is the same as a 200 tick offset.
        RayNinjaTrader Customer Service

        Comment


          #5
          The help shows multiple syntax versions so its helpful to know when to use appropriate one. I've noticed the wizard uses the last one.

          Syntax
          SetTrailStop(double currency)
          SetTrailStop(double currency, bool simulated)
          SetTrailStop(CalculationMode mode, double value)
          SetTrailStop(string fromEntrySignal, CalculationMode mode, double value, bool simulated)
          Seems as though my issues with SetTrailStop() working has to do with the concurrent use of SetStopLoss(). While testing, I can SetTrailStop() to just a few ticks and see that a named "Trail stop" order takes me out of most trades. However, when I add a SetStopLoss(), even with a huge stop loss setting, it appears that that SetTrailStop processing is suppressed and I no longer see any "Trail stop" orders being submitted although my trailing stop level has been breached.

          I am not aware of any restrictions regarding the concurrent use of StopLoss() and SetTrailStop(), and there are certainly instances where you would want to manage the two differently, particularly in a dynamic manner. Please advise.

          Thanks,

          Whitmark
          whitmark
          NinjaTrader Ecosystem Vendor - Whitmark Development

          Comment


            #6
            The first called likely will take precedence if the fromEntrySignal name is the same...both will not operate simultaneously on the same signal name. If they are different, then they will operate independantly.
            RayNinjaTrader Customer Service

            Comment


              #7
              Thanks Ray,

              Are you stating that if you place an order in a strategy (regardless if whether you specify it with a fromEntryName or not) that you cannot apply both a SetStopLoss() and SetTrailStop() to it?

              From my testing, it doesn't seem to matter what sequence they are initialized, SetStopLoss() will take precedence when both are used and render SetTrailStop() processing inoperable. This nuance, including the insight that a specified or non-specified fromEntryName can utilize SetStopLoss() or SetTrailStop() but not both, should be clarified in the Help facility.

              Whitmark
              Last edited by whitmark; 06-17-2007, 10:12 AM.
              whitmark
              NinjaTrader Ecosystem Vendor - Whitmark Development

              Comment


                #8
                This discussion has evolved to another thread to be continued on:

                whitmark
                NinjaTrader Ecosystem Vendor - Whitmark Development

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                574 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                332 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                101 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                553 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                551 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X