Function Set Stop Loss doesn't work

Symbol is improperly used and MQ5 compiler reports error.  The right function should probably be " Symbol() " , please check.




sqSetSLPT(PositionGetInteger(POSITION_TICKET), sqFixMarketPrice(sqConvertToRealPips(symbol, SetStopLossStopLoss), PositionGetString(POSITION_SYMBOL)), 0);

 


MOREOVER:


When Set Stop Loss in PIPS is used it is placing just PIPS value in place of Current Price +/- PIPS value. Please see below:


...


2020.05.08 09:22:58.378 2019.10.30 21:05:00   market buy 0.10 AUDUSD sl: 0.68511 tp: 0.68768 (0.68661 / 0.68664)

then after request to modify SL to be set as 1 PIPS (I understand that is should be set as 1 PIPS from current price):


2020.05.08 09:23:32.141 2019.10.30 21:30:00   position modified [#2 buy 0.10 AUDUSD 0.68664 sl: 0.00010 tp: 0.68773]

Attachments
No attachments
  • Votes 0
  • Project AlgoWizard
  • Type Bug
  • Status Fixed
  • Priority Normal

History

p
#1

pitro

08.05.2020 09:35

Task created

p
#2

pitro

08.05.2020 09:39

Type changed from Feature to Bug

p
#3

pitro

08.05.2020 09:42

Description changed:

Symbol is improperly used and MQ5 compiler reports error.  The right function should probably be " Symbol() " , please check.




sqSetSLPT(PositionGetInteger(POSITION_TICKET), sqFixMarketPrice(sqConvertToRealPips(symbol, SetStopLossStopLoss), PositionGetString(POSITION_SYMBOL)), 0);

 


MOREOVER:


When Set Stop Loss in PIPS is used it is placing just PIPS value in place of Current Price +/- PIPS value. Please see below:


...


2020.05.08 09:22:58.378 2019.10.30 21:05:00   market buy 0.10 AUDUSD sl: 0.68511 tp: 0.68768 (0.68661 / 0.68664)

then after request to modify SL to be set as 1 PIPS (I understand that is should be set as 1 PIPS from current price):


2020.05.08 09:23:32.141 2019.10.30 21:30:00   position modified [#2 buy 0.10 AUDUSD 0.68664 sl: 0.00010 tp: 0.68773]

Just to explain - I changed manually  " symbol" to " Symbol() " on MQ5 code level and then tried to check if it works, then I figured out that problem improper PIPS settings
TB
#4

Tomas Brynda

08.05.2020 09:56

Status changed from New to Waiting for information

Hi Pitro,

please attach the strategy that produces the code you mentioned.


Best regards,

Tomas

p
#5

pitro

08.05.2020 13:53

Attachment B5_EA_v32_to_Support.mq5 added

Attachment B5_EA_v32.sqx added

Attachment Condition with problem.jpg added

HI Tomas


You can check for AUDUSD M5 time frame for 30.10.2019 21:00 - it will be hammer closed with SL. The strategy should after 6 candles move SL to 1 pips (10 points) below current price to protect trade from Bigger SL. It is changing SL to 0.00010 value.


Both Fixed value in PIPS and Range in PIPS behave the same way.


By the way. What actually Range in PIPS means/should do for SL/TP and what is the difference between Fixed value in Pips and Range in Pips?


p
#6

pitro

08.05.2020 23:00
.... You can check for AUDUSD M5 time frame for 30.10.2019 21:00 - it will be hammer closed with SL. - ICMarkets time : CET+1


TB
#7

Tomas Brynda

18.05.2020 15:21

Status changed from Waiting for information to Fixed

Hi Pitro,

thank you for the strategy attached. I have fixed the MQL template so it will be working fine in the next release.


Range in pips is basically the same as Fixed value in pips except in Range in pips you can use a formula to calculate the value.


Best regards,

Tomas


Votes: 0

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please