Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to calculate estimated profit/loss base on the formular on the docs

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

    How to calculate estimated profit/loss base on the formular on the docs

    I got this formula here https://ninjatrader.com/support/help...tion_modes.htm

    I find it difficult to apply the formula. My mission is to calculate what will be the profit after my sellLimit TP is filled before executing the order.

    This is what i have tried according to the docs above:

    Code:
            double calcProfit(string Mode, uint LS, double quantity, double exitPrice, double entryPrice){
                /*@Params
                    Mode C=Currency, P=Percent, Po=Points, Pi=Pips,  T=Ticks
                    LS  1=long, -1=short
                @DOCS
                    https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?profit_and_loss_calculation_modes.htm
                **/
                double profitInPoint = LS * quantity * (exitPrice - entryPrice) / (exitPrice* Instrument.MasterInstrument.PointValue) / 1;
    
    
                return profitInPoint;
            }​
    But it not given me to correct profit in point.

    Please how can i calculate the profit either in Currency, Points or Percent?

    #2
    Hello tomtom555,

    For points this would be the entry minus the exit and then multiplied by the quantity.

    For currency, the above value (already calculated) would be multiplied by the point value.

    Currently you are only multiplying the exit with the point value and not the entry minus the exit first, and then multiplied by the point value.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your response. I will check an revert asap

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      169 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      88 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      128 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      208 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      185 views
      0 likes
      Last Post CarlTrading  
      Working...
      X