Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

condition based on entry order

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

    condition based on entry order

    Hi i have a strategy and I have this condition that if i have open long order and if certain price action develops i want to cancel the order. Entry order is Breakout Short.
    my question is is this the right way to specify position is short and order is from Breakout Short only?
    If


    if (Position.MarketPosition == MarketPosition.Short && Position.Account.Name == "Breakout Short"
    && ((Close[1] < Open[1] && Low[0] < Low[1] && Close[0] > Open[1])
    || (Close[0] > Open[0] && Close[1] > Open[1] && Close[3] > Open[3]) // 3 closes
    || (Close[0] > High[3])))
    {

    ExitShort(Position.Quantity);
    }​​

    #2
    Hello tkaboris,

    Thank you for your post.

    Checking if Position.MarketPosition == MarketPosition.Short will ensure you are currently in a short position before executing the ExitShort().

    Can you clarify what you are trying to do with Position.Account.Name == "Breakout Short"? If you only want the ExitShort() to affect your "BreakoutShort" entry order, you can specify the fromEntrySignal to be BreakoutShort. This ties the exit to the entry and exits the position quantity represented by the actual entry.

    ExitShort(int quantity, string signalName, string fromEntrySignal)



    Please let us know if you have any further questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    90 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    137 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    120 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    71 views
    0 likes
    Last Post PaulMohn  
    Working...
    X