Label not working properly
Label not working properly
08 Sep 2014, 12:38
Dear Support
As I cannot find a way to know if the last of my orders closed in TP, I'm trying to limit the number of positions via using the the Label.
I put the following into my cbot , but the problem is that it looks like the LabelOK bool, never comes true !!.
Can you please explain what is the default value for Label in positions and if the label documentation is correct.
bool LabelOK = false;
string TargetLabel = "NewOrderTargetLable";
if (position.Label == null || position.Label == Strategy1 + "1" || position.Label == Strategy1 + "2" || position.Label == Strategy1 + "3")
{
LabelOK = true;
if (position.Label == null)
TargetLabel = Strategy1 + "1";
if (position.Label == Strategy1 + "1")
TargetLabel = Strategy1 + "2";
if (position.Label == Strategy1 + "3")
TargetLabel = Strategy1 + "3";
}
Regards
Oltion bregu
Invalid
09 Sep 2014, 09:19
RE:
Print position.Label before if block. What will you get?
obial said:
@Invalid