TP and SL ten times higher - page 2

 
WHRoeder:
Stop complaining, you are becoming a troll. Add the error checks and find out why.

I am in no way complaining or trolling. I am trying to be as grateful as I can for all the help I am getting. I would add the checks if I knew how but my level of newbness is just too high (and yes I have read the page about Function return values, it's just still not clear enough for me).

I was just stating that when making a trade manually I can't have the TP or SL lower than 50 pips so it probably has nothing to do with the code.

If my question has somehow offended you I am sorry. I am just here to get some advice and am trying to be as clear as I can about what the problem is.

 
WHRoeder:
  1. That is because your broker does not allow stops closer than 5 pips.
  2. When you registered, perhaps you missed the part about Any discussions except of concerning MetaQuotes Language 4 and auto trading are forbidden. You're off topic for this forum.

Original question:

I have TP set to 90 and SL to 50.

The problem is that upon testing I can see it takes TP 900 and SL 500. In the settings and input, the values are correct. Changing the values to 9 and 15 doesn't work. Making a manual trade with TP 90 and SL 50 works fine.


All other information is just stuff I thought might be relevant as a reply to what someone else wrote. Why are you trying to turn this into a flame war?

 
RaptorUK:
Why doesn't it work ? what errors are you getting ? are you checking return values and reporting errors ? What are Function return values ? How do I use them ?

My reply is still valid, if you add checks on the return values and print the errors you will know why the OrderModify() fails . . . make an attempt, show what you changed. If you don't want to try then go here and ask for it to be coded for you.
 
RaptorUK:
My reply is still valid, if you add checks on the return values and print the errors you will know why the OrderModify() fails . . . make an attempt, show what you changed. If you don't want to try then go here and ask for it to be coded for you.


I will try and let you know thanks for the help.

Do I understand it correctly that what I normally use as TP 90 IS actually 900 and the code works correctly?

And that the minimum of my broker 50 is actually 5? That means TP 9 should work and if not I should find out why?

 
jc_gucci:

I will try and let you know thanks for the help.

Do I understand it correctly that what I normally use as TP 90 IS actually 900 and the code works correctly?

And that the minimum of my broker 50 is actually 5? That means TP 9 should work and if not I should find out why?


I'll answer this myself, I just found out that's exactly what the problem was.

Also turns out the minimum for the pair I was testing this on was actually 9, not 5 and that's why the code didn't work

Again thanks a lot for your help!

 
jc_gucci:

I will try and let you know thanks for the help.

Do I understand it correctly that what I normally use as TP 90 IS actually 900 and the code works correctly?

And that the minimum of my broker 50 is actually 5? That means TP 9 should work and if not I should find out why?

What you enter as your SL & TP in the EA is multiplied by 10 if your symbol has 3 digits or 5 digits . . .

  double MyPoint=Point;
  if(Digits==3 || Digits==5) MyPoint=Point*10;

. . . so yes if you enter 90 and you are using a 3 or 5 digit symbol your TP will be 900 points ( 90 pips ).

The STOPLEVEL and FREEZELEVELS quoted by your Broker are in points, so 50 will be 50 points or 5 pips for a 3/5 digit symbol.

The code you posted makes no attempt to validate the orders it places or modifies based on the FREEZE and STOP LEVELS, it is poorly written and missing many, many basic essentials . . . regarding what validation needs to be done, all the info you need is here: Requirements and Limitations in Making Trades

Reason: