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

Coding in Multiple Entries with Various Breakeven, Stop, Targets

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

    Coding in Multiple Entries with Various Breakeven, Stop, Targets

    Hi,

    I would like to setup in my strategy a code to allow me to enter multiple contracts, with a stop and different targets.

    Scenario 1: I would like to have 2 Contracts go in, both with a similar stop of let's say 100 ticks. The first contract exits at 50 ticks positive at which point the 2nd Contract's stop moves from 100 tick stop to be positive 5 ticks above entry.

    Scenario 2: 2 Contracts are in, stop is 100 ticks, 1st contract gets out at 50 ticks, breakeven moves up +5 in my favor like above. Then trade keeps going in my favor, and based on entry conditions adds 2 more contracts, with 100 tick stop, 1st contract at 50 ticks up, breakeven moves the 2nd remaining contract +5 ticks above Breakeven again.

    The 2nd Scenario will have 2 contracts now, with a New Average price and breakeven.

    Scenario 3: Similar to above 100 tick stop, 1st contract exit at 50 ticks positive, 2nd Contract keeps going and moves stop +5 from entry. As momentum continues to go, more contracts (Qty of 2) at a time are added in on each new candle, with the same or different strategy, where 1st contract scalps and moves stop loss in favor and allow the remaining contracts to ride.


    Currently, I am struggling to put this in because every time I put in more than 1 contract, the average moves but they all exit at the same time. also, when the direction changes and I still have contracts in for let's say Long positions, and Short conditions hit, it exits all Long trades. I do not want this, I want to allow it to take both long and short orders if the conditions are correct, but I want them to keep using their programmed stop and targets.


    Any help will be greatly appreciated.

    #2
    Hello bpatel20,

    EntriesPerDirection should be set to the total number of orders (not contracts).

    Each entry should have a unique signal name.

    Each exit order or set method should be using that signal name in the from Entry Signal.

    Below is a link to a simplified example.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,602 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    8 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    18 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    4 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    12 views
    0 likes
    Last Post Javierw.ok  
    Working...
    X