here is one example:
void OnTick(){ double sumProfits=0; bool checked=false; for (int pos=0;pos<OrdersTotal();pos++){ if (!OrderSelect(pos,SELECT_BY_POS)) continue; if (OrderType()>=2) continue; sumProfits +=OrderProfit(); if (!checked) checked=true; } if (NormalizeDouble(sumProfits,0)==0 && checked) Alert("Breakeven reached"); }
javiervillagran96: how to calculate the distance so that two or more open trades reach a breakeven.
Break even price = Lots weighted average price.
OrderOpenPrice
question . - MQL4 programming forum
looking for sample code on
how to calculate the price BE for a few Buy and Sell orders simultaneously -
Pips - MQL4 programming forum
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
how to calculate the distance so that two or more open trades reach a breakeven.