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

Manual Stop Loss move not working when set using SetStopLoss

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

    Manual Stop Loss move not working when set using SetStopLoss

    Hi,

    I set a stop loss through my strategy in OnBarUpdate() and also through a button click that I have on the chart trader. Both are set using SetStopLoss function. But when I try to manually move the stop loss, it gets put back to the last set position using SetStopLoss when a new bar prints.

    SetStopLoss is not called on every bar update in my code for this to happen. How do I prevent this?

    #2
    I think I found the answer:
    Hi I would like to be able to move the stop manually in a strategy created in strategy builder, is there any line of code that could help to be able to move the SL and target once the order is placed?

    Comment


      #3
      Hello admiralpanda,

      This is correct, Set methods update on every bar update and would revert to their script appointed price.

      Use Exit methods submitted once from OnExecutionUpdate() with isLiveUntilCancelled as true and these won't revert to the script appointed price and can be manually modified.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Does closing the position using ExitShort(/Long) or Enter(Opposite Direction) auto close the ExitLong(Short)StopLimit and ExitLong(Short)Limit?

        Comment


          #5
          Hello admiralpanda,

          To confirm, you are specifically asking about using market orders correct?

          Further, you are asking if the existing position is closed when calling an entry market order in the reverse direction, is this also correct?

          Yes, when using the managed approach NinjaTrader will automatically submit a 'Close position' order to exit the close the existing position, before submitting the new entry order.
          Note, if an Exit and Enter market order method is called at the same time, this will typically result in doubling the position quantity in the opposite direction due to this 'Close position' order.
          Hello, I want to create an indicator that show data in a chart but calculate in other charttime different to the time of the chart where is showed. For example:
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            What would be the "execution.Order.Name"
            when it hits the profit target set by ExitLongStopLimit?

            I want to set my second entry to break even when it hits the first profit target.

            Comment


              #7
              Hello admiralpanda,

              This would depend on what you have provided as the signalName.
              ExitLongStopLimit(double limitPrice, double stopPrice, string signalName, string fromEntrySignal)


              If you provide "longExit1" as the signal name, this will be the name of the order in OnExecutionUpdate().
              If you have used an overload without signalName it will be named Buy or Sell depending on the order action.
              If you provided a empty string as the signal name the order will be an empty string value (and will not have a name).
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by llanqui, Today, 03:53 AM
              0 responses
              6 views
              0 likes
              Last Post llanqui
              by llanqui
               
              Started by burtoninlondon, Today, 12:38 AM
              0 responses
              10 views
              0 likes
              Last Post burtoninlondon  
              Started by AaronKoRn, Yesterday, 09:49 PM
              0 responses
              15 views
              0 likes
              Last Post AaronKoRn  
              Started by carnitron, Yesterday, 08:42 PM
              0 responses
              11 views
              0 likes
              Last Post carnitron  
              Started by strategist007, Yesterday, 07:51 PM
              0 responses
              14 views
              0 likes
              Last Post strategist007  
              Working...
              X