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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        87 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        131 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        106 views
        0 likes
        Last Post CarlTrading  
        Working...
        X