I hope this has not be answered somewhere before, but I can't seem to find the answer.
I have written an indicator that sums all of the positions in a particular instrument, and works out the cumulative target value, and risk in terms of the deposit currency (ZAR in this case).
I am using the following formulas which work about half the time, in some cases it is out by a factor or 10 or 100. I'm sure there is something that needs to be read from MarketInfo() but I can't figure it out. Can anyone help?
target = (OrderTakeProfit() - OrderOpenPrice()) * OrderLots()* LotSize * MarketInfo(Symbol(), MODE_TICKVALUE )
stoploss_exposure = (OrderStopLoss() - OrderOpenPrice()) * OrderLots() * LotSize * MarketInfo(Symbol(), MODE_TICKVALUE )