Where are you putting the comments in your code?
When you have 2 comments, the first one is replaced so quickly that you don't see it
The first comment doesnt work, but the second does... why? too much text?
That is not your real code, as it will not compile. There is executable code outside of a function (globally scoped) and you define the variable "comment" twice and the contents is assigned before the actual data is available.
You will have to supply more realistic code, that includes calling Comment(), for it be scrutinized by us correctly.
Also, when using the Comment() function, it will always replace the previous one displayed. It will not append to it and you will have to do that yourself in your code.
EDIT: PS! Also, instead of "adding" strings together, use StringConcatenate() so as to prevent any undue problems with string corruption that has been reported by some users.
Where are you putting the comments in your code?
When you have 2 comments, the first one is replaced so quickly that you don't see it
res=OrderSend(Symbol(),OP_SELL,WielkoscPozycji,Bid,3,SLs,OrderTakeProfit(),"1Dsell "+comment,MAGICMA,0,Red);
ofcourse there is 1 variable "comment" but for checking whats wrong a pasted 2 versions. It looks like there is some limit in signs...
edit//// 27-31 signs for Order comment, if more rejected
edit//// 27-31 signs for Order comment, if more rejected
There is a difference between comments on the chart (namely Comment() function) and Order Comments. So in future posts, please be clear about to which one you are referring.
As for Order Comments, you cannot depend on them because not all brokers support it. Some allow it, but only for short strings and with a restricted character set, while others even change the contents completely for their own use.
So, the recommendation is not to use it at all, or if you do, don't depend on it at all for any kind of processing or follow-up.
You should rather rely on the built-in journal log (with the Print() and PrintFormat() functions) or output your own logs to user files.
I also call your attention again about not "adding" strings together, but to rather use StringConcatenate() so as to prevent any undue problems with string corruption that has been reported by some users.
There is a difference between comments on the chart (namely Comment() function) and Order Comments. So in future posts, please be clear about to which one you are referring.
As for Order Comments, you cannot depend on them because not all brokers support it. Some allow it, but only for short strings and with a restricted character set, while others even change the contents completely for their own use.
So, the recommendation is not to use it at all, or if you do, don't depend on it at all for any kind of processing or follow-up.
You should rather rely on the built-in journal log (with the Print() and PrintFormat() functions) or output your own logs to user files.
I also call your attention again about not "adding" strings together, but to rather use StringConcatenate() so as to prevent any undue problems with string corruption that has been reported by some users.
Thank you for your advice. Plz tell me how could I present the values of indicators (in D1 period) while backtesting EA on H1 timeframe. If the periods match the indicator is on the chart or below... but how to show them (on the screen with charts or below them) in this case? My way was using Order comment, do you know any better?
I have already answered that in my previous post and I quote:
You should rather rely on the built-in journal log (with the Print() and PrintFormat() functions) or output your own logs to user files.
I have already answered that in my previous post and I quote:
You should rather rely on the built-in journal log (with the Print() and PrintFormat() functions) or output your own logs to user files.
Brt88: but the problem is that the indicators are calculated on a differrent timeframes.
| Why is that a problem? They return a value, show it! |
I have already clarified where i would like to see the comment or any type of info about the values of indicators "(on the screen with charts or below them) " not in journal nor in log. It coud be some kind of indicator below chart but the problem is that the indicators are calculated on a differrent timeframes. (indicators - D1, backtesting -H1)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I would like to have comments when opening trade (backtesting). It will be indicators values like below.
The first comment doesnt work, but the second does... why? too much text?