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 kinfxhk, 07-14-2026, 09:39 AM
        0 responses
        125 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 10:18 AM
        0 responses
        105 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 09:50 AM
        0 responses
        85 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 07:21 AM
        0 responses
        105 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-11-2026, 02:11 AM
        0 responses
        85 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X