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 warreng86, 11-10-2020, 02:04 PM
    7 responses
    1,360 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Perr0Grande, Today, 08:16 PM
    0 responses
    5 views
    0 likes
    Last Post Perr0Grande  
    Started by elderan, Today, 08:03 PM
    0 responses
    9 views
    0 likes
    Last Post elderan
    by elderan
     
    Started by algospoke, Today, 06:40 PM
    0 responses
    10 views
    0 likes
    Last Post algospoke  
    Started by maybeimnotrader, Today, 05:46 PM
    0 responses
    14 views
    0 likes
    Last Post maybeimnotrader  
    Working...
    X