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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        161 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        309 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        245 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        349 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X