Reply

problem with assigning TP/SL

3 replies

stickytrader

Subscriber, bbp_participant, 38 replies.

Visit profile

4 years ago #248885

I am trying to use an int variable as SL and TP , it is a simple number between 5 and 10 ( without decimal ) , when I run the script  I see a message which shows that there is a problem with SL and TP.

To get sure my int variable is true I print it in journal and it is what it is expected  ( 10 for example ) , but the “Inter the market ” action can’t add it to the price to have the TP price .

it seems like problems related to double and int variables but I am only using int variables so why 1.19360(current price ) – 10pips(TP) = 11.1936  ??!!

EA-Wizard EURUSD,H1: open #3 sell 0.10 EURUSD at 1.19360 ok

EA-Wizard EURUSD,H1: open #3 sell 0.10 EURUSD at 1.19360 ok0 20:46:48.759 2018.01.10 07:00:00  Morningposition

EA-Wizard EURUSD,H1: 2018.01.10 07:00 Order opened with ticket: 3 at price:1.19360 20:46:48.759 2018.01.10 07:00:00  Morningposition

EA-Wizard EURUSD,H1: —VERBOSE— 2018.01.10 07:00 Order with Magic Number: 13 opened with ticket: 3 at price:1.19360 20:46:48.759 2018.01.10 07:00:00  Morningpositio

EA-Wizard EURUSD,H1: —VERBOSE— 2018.01.10 07:00 Setting SL/PT, try #10 20:46:48.759 2018.01.10 07:00:00  Morningposition

EA-Wizard EURUSD,H1: —VERBOSE— 2018.01.10 07:00 Setting SL: 11.1936 and PT: -8.8064 for order3 20:46:48.759 2018.01.10 07:00:00  Morningposition

EA-Wizard EURUSD,H1: invalid takeprofit for OrderModify function3 20:46:48.759 2018.01.10 07:00:00  Morningposition

EA-Wizard EURUSD,H1: OrderModify error 40510 20:46:48.759 2018.01.10 07:00:00  Morningposition

EA-Wizard EURUSD,H1: —VERBOSE— 2018.01.10 07:00 Error modifying order: 4051 : invalid function parameter value

 

 

 

And these are the commands in EAwizard :

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

4 years ago #248915

Hello,

I see the value PT: -8.8064 … you should use Round() function to remove the decimal portion of the value so you get 8

0

stickytrader

Subscriber, bbp_participant, 38 replies.

Visit profile

4 years ago #248923

As you see in the image I have already used mathround()  fundction . and I even printed the value in the journal and there is no decimal .

both the prices : SL: 11.1936 and PT: -8.8064 are wrong. this is what I have done :

the current price is 1.19360 I set the SL and PT to 10 pips ( by using SL and PT  fields in “enter the market” command ) and it returns : SL: 11.1936 and PT: -8.8064 instead of adding 10 pips and reducing 10 pips from the price mentioned .

 

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

4 years ago #248930

Can you attach your project? I will test. You can also use the private section of the forum or send to [email protected]

0

Viewing 3 replies - 1 through 3 (of 3 total)