nice, having the breach line right on the chart beats doing the math by hand one thing in GetMidnightBalance(): it takes the current balance and subtracts only today's buy/sell deals. a deposit or withdrawal made today (DEAL_TYPE_BALANCE, e.g. a payout) isn't subtracted, so the 00:00 base, and the breach line with it, shifts by that amount. subtracting balance/credit deals in the same loop would fix it
Vira Ohloblia #:
nice, having the breach line right on the chart beats doing the math by hand one thing in GetMidnightBalance(): it takes the current balance and subtracts only today's buy/sell deals. a deposit or withdrawal made today (DEAL_TYPE_BALANCE, e.g. a payout) isn't subtracted, so the 00:00 base, and the breach line with it, shifts by that amount. subtracting balance/credit deals in the same loop would fix it
nice, having the breach line right on the chart beats doing the math by hand one thing in GetMidnightBalance(): it takes the current balance and subtracts only today's buy/sell deals. a deposit or withdrawal made today (DEAL_TYPE_BALANCE, e.g. a payout) isn't subtracted, so the 00:00 base, and the breach line with it, shifts by that amount. subtracting balance/credit deals in the same loop would fix it
For DEAL_TYPE_BALANCE (payouts), skipping it in the trade loop was intentional. Prop firms drop your daily floor by the withdrawal amount as soon as a payout is processed. If someone pulls $5k from a $105k account and the base stays at $105k, a 5% limit puts the breach line at $99,750 on a $100k balance—leaving only $250 of room.
Also a quick note on DEAL_TYPE_CREDIT: in MT5, credit deals go to ACCOUNT_CREDIT, not ACCOUNT_BALANCE, so subtracting them from AccountInfoDouble(ACCOUNT_BALANCE) would skew the 00:00 balance math. Standalone entries like DEAL_TYPE_COMMISSION, DEAL_TYPE_CHARGE, and DEAL_TYPE_CORRECTION do hit the balance directly though.
Your comment did make me check the 00:00 HWM GlobalVariable snapshot, and I noticed it wasn't shifting when an intraday payout happened.
Just pushed v1.01 to fix the HWM shift, properly account for standalone fee/correction deals, and added an InpCashflowMode input (CASHFLOW_REANCHOR_BASE for prop firms, or CASHFLOW_KEEP_0000_BASE if you want the strict unshifted 00:00 balance). Thanks for the heads up.
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
Prop Firm Live Daily Breach Line (OrderCalcProfit and iCustom Ready):
Real-time daily drawdown buffer monitor and exact breach price line indicator for prop firm accounts. Features 00:00 server-time deal history reconstruction (including entry commissions), 00:00 HWM snapshot locking, two-stage OrderCalcProfit cross-rate calibration, and iCustom() data buffers for Expert Advisors.
Author: Nazim Yurtcan