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 NullPointStrategies, Today, 05:17 AM
      0 responses
      46 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      66 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X