Display your account balance in a chart

 

Hello,


Working on a custom indicator, and have no problem writing normal text to the screen, but how would I write my account balance on the screen?


ObjectSetText("AccountBal", "Account balance:", 7, "Verdana", Yellow); <-- How i write text

ObjectSetText("AccountBalDsp", Accountbalance(), 7, "Verdana", White); <-- Doesn't work, and gets "LABEL" written on the screen.



Thanks for anyone who can lend a hand!

 
trader346 wrote >>

Hello,

Working on a custom indicator, and have no problem writing normal text to the screen, but how would I write my account balance on the screen?

ObjectSetText("AccountBal", "Account balance:", 7, "Verdana", Yellow); <-- How i write text

ObjectSetText("AccountBalDsp", Accountbalance(), 7, "Verdana", White); <-- Doesn't work, and gets "LABEL" written on the screen.

Thanks for anyone who can lend a hand!

try this:

ObjectSetText("AccountBalDsp", DoubleToStr(Accountbalance(), Digits), 7, "Verdana", White);

Reason: