Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculating the amount of loss

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

    Calculating the amount of loss

    Hi!

    I'm wondering how the NT8 calculates the amount of loss.
    Click image for larger version

Name:	image.png
Views:	120
Size:	7.5 KB
ID:	1336737
    I entered long at 105.15 and my stop loss was triggered at 90.22. The order quantity is 1
    Click image for larger version

Name:	image.png
Views:	117
Size:	6.8 KB
ID:	1336738​The amount of loss is $14,960
    1. How is this value calculated?
    2. How do I set a protective stop at $5000 loss per trade in the OnExecutionUpdate?


    Thank you!

    #2
    Hello muaythai,

    The values calculated would be based on the executions and the prices at the time of the orders.

    To set up stoploss orders at a specific price that depends on how you made the strategy, did you use the builder or are you manually coding?

    In manual coding you can use the following example: https://ninjatrader.com/support/help...nce_statis.htm

    Comment


      #3
      Hi!

      I solved it by retrieving the point value of the instrument
      Code:
      pointValue = Instrument.MasterInstrument.PointValue;
      And calculated the stop loss
      Code:
      protectiveSlPrice = execution.Order.AverageFillPrice - pointValue / maxLoss;
      Thank you for the help!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      160 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      81 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      125 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      206 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      184 views
      0 likes
      Last Post CarlTrading  
      Working...
      X