//+------------------------------------------------------------------+ //| Total_Risk.mq4 | //| Copyright © 2018, Gehtsoft USA LLC | //| http://fxcodebase.com | //+------------------------------------------------------------------+ #property copyright "Copyright © 2018, Gehtsoft USA LLC" #property link "http://fxcodebase.com" #property indicator_chart_window #property indicator_buffers 0 int init() { IndicatorShortName(""); IndicatorDigits(Digits); return(0); } int deinit() { return(0); } int start() { if(Bars<=3) return(0); double Balance=AccountBalance(); int i; double Profits=0.; double Losses=0.; double Total, BalPS; for (i=0; i0.) { Profits+=OrderProfit(); } else { Losses+=-OrderProfit(); } } Total=Profits-Losses; BalPS=100.*Total/Balance; } string Str="Profit: "+Profits+"\nLoss: "+Losses+"\nTotal: "+Total+"\n% of balance: "+BalPS; Comment(Str); return(0); }