I got issues developping a strategy which have to modify the stop loss the error I get is in french but the traduction will give something like the variable is used before it is instanciated. I understand why I can get such error, but not how to deal with it since it is caused but a SetStopLoss method. I explain my code: I have a method for setting an initial stoploss and call the enterLongLimit method, one other method is waiting for some condition to raise and then call the setstoploss again to modify the stop. Still the condition can raise at any time it is possible that I call two times the setstopLoss method before the trade is filled. Is it problematic? I should also notice that because I have a lot of trades at the same moment I use tags to identify my trade.
I did some tests and it seems to be my order who disappear so I can't use the Tag, I can save the tag, but there is any explanation of why my order disappear (== null) after it is filled.
Thank you in advance,
R.E.

Comment