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:
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;
}
Please how can i calculate the profit either in Currency, Points or Percent?

Comment