Moving TP & SL
18 replies
CTC
8 years ago #113786
Hi,
I am trying to do this:
if OpenProfit(magicBuy) > Variable1 then
Move SL to CurrentPrice – Variable1 and
MoveTP to min(currentPrice+TP + Variable2,CurrentPrice+MaxTP) (ie. if maxTp is reached I close the order)
.
How is this accomplished?
I attach a sample SQW for your consideration…
Please consider that MagicNumbers are variables as the EA could run on different Pairs.
Thanks a lot,
Claudius
tomas262
8 years ago #131678
I could be wrong but I see magicNoSell with small “m” in the beginning which could be the cause of the error message.
CTC
8 years ago #131694
M is capital in the attached. Same error. Plus the change of MagicNo is not accepted in the second one. Please see attached…
Thanks
tomas262
8 years ago #131749
Hello,
tried to change magic number from Buy to Sell and got it without any problems. You just have to click through inside the condition into the deepest member using “…” button.
Also edited in Adjust SL “Market position is Long” into “Market position is Short”
See attached