Comment is always in the top left. A very cheap, quick way is to add \n a few times to the comment, eg:
comment = "\n\n\n\n\n\n\n\n\n\nlot size less than minimal allowed lot for risk and stop loss setting\n"+ "calculated lot size : "+DoubleToStr(lots,norm)+" minimal allowed : "+DoubleToStr(minLot,norm)+"\n"+ "risk with minimal lot size and stop loss set to : "+DoubleToStr(StopLoss,2)+"pips is : "+DoubleToStr(actualRisk,2)+"%";
Each one adds a new line so you might need a lot.
A better way if you have time is to use ObjectCreate to make a label which can be anchored to any corner (which means, it will work even if you change screen resolution).
- You didn't save it
- You didn't compile it
- You didn't exit and restart the tester
- You installed in \program files* and have UAC issues.
I don't think it can be any of those things because when i change other parts of the code i can see the indicator has changed on the charts (except for its position). Perhaps i have misunderstood something, here is the code
//+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ #property indicator_chart_window extern double StopLoss = 20; extern double RiskPercent = 10; // // // // // int init() { return(50); } int deinit() { return(0); } int start() { double pipValue = MarketInfo(Symbol(),MODE_TICKVALUE); if (Digits==3 || Digits==5) pipValue *= 10; double step = MarketInfo(Symbol(),MODE_LOTSTEP); int norm = 0; if (step==1) norm = 0; if (step==0.1) norm = 1; if (step==0.01) norm = 2; double minLot = MarketInfo(Symbol(),MODE_MINLOT); double maxLot = MarketInfo(Symbol(),MODE_MAXLOT); double lots = AccountBalance()*(RiskPercent/100.0)/(StopLoss*pipValue); lots = NormalizeDouble(lots,norm); // // // // // double actualRisk; string comment = DoubleToStr(StopLoss,0)+"SL "+DoubleToStr(RiskPercent,0)+"% risk "+DoubleToStr(lots,norm); if (lots<minLot) { actualRisk = (100*minLot*StopLoss*pipValue)/AccountBalance(); comment = "\n\n\n\n\n\n\n\n\n\nlot size less than minimal allowed lot for risk and stop loss setting\n"+ "calculated lot size : "+DoubleToStr(lots,norm)+" minimal allowed : "+DoubleToStr(minLot,norm)+"\n"+ "risk with minimal lot size and stop loss set to : "+DoubleToStr(StopLoss,2)+"pips is : "+DoubleToStr(actualRisk,2)+"%"; } Comment(comment); return(0); }
I don't think it can be any of those things because when i change other parts of the code i can see the indicator has changed on the charts (except for its position). Perhaps i have misunderstood something, here is the code
You missed something . . .
string comment = "\n\n\n\n\n\n\n\n\n\n" + DoubleToStr(StopLoss,0)+"SL "+DoubleToStr(RiskPercent,0)+"% risk "+DoubleToStr(lots,norm);
- Or simply combine
string comment = DoubleToStr(StopLoss,0)+"SL ... : comment = "lot size less than minimal ... : Comment(\n\n\n\n\n\n\n\n\n\n"+comment);
- kcomplex: its just being covered over by my one-click EA at the moment (i can't move the one click trading ea).How can you be running any code when you have a "one-click EA" running? You can't run two EAs on the same chart.
If you mean the one-clickjust minimize it

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Could someone please help me amend this code so the text is shown in the bottom left hand corner of the chart window rather than the top left corner which is where it currently appears?