Set Fixed SL and TP

CARPARK

Trader
Mar 29, 2021
64
20
24
46
Tallinn
Hi there, I'm trying to apply the following script available in the software library to DAX30 CFD (have also tried with regular fx pair) but it fails with the error:

2021.09.15 10:18:40.714 SetFixedSLandTP_v1-0 GER30.cash,M1: Order failed to update with error - 1

I was wondering if anyone was familiar with this script could tell me what I am doing wrong?

Settings attached
 

Attachments

  • Screenshot 2021-09-15 102509.png
    Screenshot 2021-09-15 102509.png
    13 KB · Views: 16

Enivid

Administrator
Staff member
Nov 30, 2008
17,852
1,225
144
Odesa
www.earnforex.com
Hi there, I'm trying to apply the following script available in the software library to DAX30 CFD (have also tried with regular fx pair) but it fails with the error:

2021.09.15 10:18:40.714 SetFixedSLandTP_v1-0 GER30.cash,M1: Order failed to update with error - 1

I was wondering if anyone was familiar with this script could tell me what I am doing wrong?

Settings attached
Error 1 means ERR_NO_RESULT (No error returned, but the result is unknown). I only get this error when I am trying to set the same SL and TP as the order already has set on it. Try modifying the SL and TP to some different values.
 

CARPARK

Trader
Mar 29, 2021
64
20
24
46
Tallinn
Yeah I've used it on a symbol I frequently use different EAs on.

I'll try some other stuff and see if I can get anywhere with it...
 
  • 👍
Reactions: Zoom

Enivid

Administrator
Staff member
Nov 30, 2008
17,852
1,225
144
Odesa
www.earnforex.com
The Set Fixed SL and TP script has been updated to version 1.01 to introduce numerous changes:
  • Added an MT5 version of the script.
  • Added an option to apply stop-loss and take-profit based on the current price rather than open price.
  • Added an option to work with pending orders as well.
  • Added an option to set SL and TP not only for the current trading symbol.
  • Added an option to skip either SL or TP by setting the respective input parameter to zero.
  • Added a filter based on trade's direction.
  • Changed the script to work based on points rather than pips.
  • Removed the Slippage input parameter (wasn't used).
  • Refactored the MQL4 code.