Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnExecution stopOrder

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

    OnExecution stopOrder

    If I previously had..
    SetStopLoss(CalculationMode.Percent, stoppercent);

    how do I fit this into the stopOrder below. Something like this maybe?...

    stopOrder = ExitLongStop(0, true, execution.Order.Filled, execution.Order.AvgFillPrice - execution.Order.AvgFillPrice * stoppercent, "", "");

    #2
    Hello zachj,

    Thank you for your post.

    It should be the following for the ExitLongStop():
    Code:
    stopOrder = ExitLongStop(0, true, execution.Order.Filled, ((execution.Order.AvgFillPrice) * (1 + stoppercent)), "", "");
    Please let me know if you have any questions.

    Comment


      #3
      Wait wouldn't it actually be just execution.Order.AvgFillPrice * stoppercent?

      If fill price is say $50 and stoppercent is .01 that would be a 50cent stop.

      If I did this... ((execution.Order.AvgFillPrice) * (1 + stoppercent)) that's 50*1+.01 = 50.5? Doesn't make sense or am I misinterpreting that.

      Comment


        #4
        Hello zachj,

        Thank you for your response.

        My mistake on that part, with the Long Stop the stoppercent would need to be a negative number.

        Code:
        So taking your example if would be the following:
        stopOrder = ExitLongStop(0, true, execution.Order.Filled, ((execution.Order.AvgFillPrice) * (1 + -0.01)), "", "");

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        606 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        353 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        560 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        561 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X