Help with setting label or comment
Help with setting label or comment
25 Apr 2019, 22:45
Hi cTrader Community,
I need some help with the following; I want to set a certain label or comment during the creation of a position. A fixed one is easy to do, but I want it to be dynamic.
So now I have it set during start of Cbot:
[Parameter("Label", DefaultValue = "m5")]
public string LabelTrade { get; set; }
I am calculating a certain value, a currency strenght High and Low. Values vary from -7 to 7. I want to add these values to the label of the position; so for example:
"EUR = 7, USD = -7"
So for this I have:
double EURvalue;
double USDvalue;
How can I get these calculated values as TEXT in the label of a position?
for example: string LabelTrade = ("EUR =" + EURvalue "& USD =" + USDvalue);
Hope this makes sense!
Thanks in advance.
sascha.dawe
26 Apr 2019, 10:10
RE - Help with setting label or comment
Hi,
You could try something like this:
string LabelTrade = string.Format("EUR = {0} & USD = {1}", EURvalue, USDvalue);
Is this what you are looking for?
I don't think you can change the label on an existing position (Correct me if I am wrong), buy you could use this created string on a new position.
If you are looking to change add a description to an existing position, you could alter the position 'comment' field as opposed to 'label'.
Best Regards,
Sascha
@sascha.dawe