Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Design Problem

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

    Strategy Design Problem

    I was hoping someone with more experience of the various programming functions could give me some guidance.

    My strategy works as follows
    1. Entry signal
    2. Offset entry level and stop value from current bar stored as Double
    3. entry order at stored entry price using a stop order.
    4. Exit order (protective stop) at stored stop price using a stop order.
    The problem I have relates to the protective stop order. Once triggered, I need it to reset the Doubles so the last entry isn't repeated, but as it is an order, I don't want it to re-set the levels until it is triggered. Is there anyway of programming a set of conditions once a stop order is triggered?

    Many thanks

    Mark

    #2
    Hello,

    If I understand, OnExecution() will do what you want:


    Or OnPositionUpdate():


    And if the stop makes you flat you could use Position.MarketPosition == MarketPosition.Flat:
    DenNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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