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

2 steps scaling out, second step replaces profit and stop with trailing stop

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

    2 steps scaling out, second step replaces profit and stop with trailing stop

    Hello,

    I am trying to code a opening range breakout strategy (OBR) (code attached). My stop1 is 1 ATR away and my profit1 is 2 ATR away. To scale out progressively, I have the same entry with my stop2 1 ATR away and my profit2 3 ATR away.

    Once the first profit target is reached, I would like to enter the market with a trailing stop 1ATR away from closing, and cancel stop2 and profit2 (in this chronological order so that I always have a stoploss order active).

    I have tried both with ExitShortStopMarket and with SetStopLoss methods (only for shorting in the code). The later I am not even able to use, it doesn't work when I set the stop and limit (code line in comment) By the way what's the difference between these two?

    Can you help me out with this please?

    Thank you very much.

    Best,
    Attached Files

    #2
    Hello pompboss,

    You have stated:
    "I have tried both with ExitShortStopMarket and with SetStopLoss methods (only for shorting in the code). The later I am not even able to use, it doesn't work when I set the stop and limit (code line in comment)"

    What didn't work?

    Did you receive an error message? (If so, what is the error message?)

    What the order at an incorrect price? (If so, what price was printed that is the correct price, and what did the TraceOrders show?)
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by selu72, Today, 02:01 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by WHICKED, Today, 02:02 PM
    2 responses
    9 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by f.saeidi, Today, 12:14 PM
    8 responses
    21 views
    0 likes
    Last Post f.saeidi  
    Started by Mikey_, 03-23-2024, 05:59 PM
    3 responses
    50 views
    0 likes
    Last Post Sam2515
    by Sam2515
     
    Started by Russ Moreland, Today, 12:54 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Erick  
    Working...
    X