Sum of all Open Stop Losses (in USD), expressed as a % of Total Account value, where the base account is in USD
MQL4 and MetaTrader 4, has it's own section on the forum. I have moved your topic to the correct section. Please don't create another topic.
AccountBalance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the spread, and DeltaPerLot is usually around $10/PIP, but it takes account of the exchange rates of the pair vs. your account currency.)
Replace OOP with OrderClosePrice and sum
Forum on trading, automated trading systems and testing trading strategies
How to calculate take profit from currency
Fernando Carreiro, 2022.09.05 17:00
These are all the same equation written in different ways ...
[Volume] = [Money Value] * [Tick Size] / ( [Tick Value] * [Stop Size] ) [Stop Size] = [Money Value] * [Tick Size] / ( [Tick Value] * [Volume] ) [Money Value] = [Volume] * [Stop Size] * [Tick Value] / [Tick Size] [Volume] in lots [Stop Size] in quote price change [Money Value] in account currency
Forum on trading, automated trading systems and testing trading strategies
Please advice me how to calculate average TP for Grid.
Fernando Carreiro, 2022.12.26 13:47
Here is the maths for calculating net values for a batch of positions:AccountBalance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the spread, and DeltaPerLot is usually around $10/PIP, but it takes account of the exchange rates of the pair vs. your account currency.)
Replace OOP with OrderClosePrice and sum
Thank you for your feedback.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have developed the below code to try and sum all open stop losses, across multiple currencies in the portfolio and then express as a % of the Total Account Value (in USD base currency). I don't get an output that makes sense - can anyone help improve the code to give an accurate and stable result?