Moving TP & SL

18 replies

CTC

Subscriber, bbp_participant, community, 14 replies.

Visit profile

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

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

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.

0

CTC

Subscriber, bbp_participant, community, 14 replies.

Visit profile

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

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

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

0

Viewing 3 replies - 16 through 18 (of 18 total)

1 2