How do you usually exeute trades calculated by Position Size Calculator?

  • Manually

    Votes: 12 15.2%
  • PSC-Trader script with a mouse click

    Votes: 13 16.5%
  • PSC-Trader with a keyboard shortcut

    Votes: 51 64.6%
  • Using third-party trading panel

    Votes: 2 2.5%
  • Other (please provide details)

    Votes: 1 1.3%

  • Total voters
    79
  • Poll closed .
Status
Not open for further replies.

EnrichWave

Master Trader
May 15, 2018
325
82
74
India
Could any one write a script to change the SL TP of opened, pending orders which price value taken from SL, TP lines?

Kind Regards
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
Could any one write a script to change the SL TP of opened, pending orders which price value taken from SL, TP lines?

Do you mean a script that would rewrite SL/TP for all existing trades in a given account? If so, you can try modifying the attached script to read the SL/TP line values and use them to set the trades' SL/TP.
 

Attachments

  • Modify_All_TP_SL.mq4
    6.6 KB · Views: 5
  • 👍
Reactions: EnrichWave

dy_eyeconical

Trader
Dec 2, 2019
1
0
7
Seattle, WA
Hello there. To anyone that may be reading this. How difficult would it be to port this and to make this indicator work in tradingview charts? Does anyone know how i could code this up?
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
Hello there. To anyone that may be reading this. How difficult would it be to port this and to make this indicator work in tradingview charts? Does anyone know how i could code this up?
From what I've seen when I last looked at TradingView's PineScript, it would impossible. The main reasons are the lack of account information functions and on-chart panel drawing tools.
 

EnrichWave

Master Trader
May 15, 2018
325
82
74
India
Do you mean a script that would rewrite SL/TP for all existing trades in a given account? If so, you can try modifying the attached script to read the SL/TP line values and use them to set the trades' SL/TP.
Exactly dude., but for MT5..
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
There are two versions for MT5. The one in the zip archive is a rough conversion of MQL4 code, the one in a single .mq5 file is a rewrite for MQL5.
 

Attachments

  • Modify_All_TP_SL.zip
    181.5 KB · Views: 8
  • Modify_All_TP_SL.mq5
    6.7 KB · Views: 4
  • 👍
Reactions: EnrichWave

EnrichWave

Master Trader
May 15, 2018
325
82
74
India
There are two versions for MT5. The one in the zip archive is a rough conversion of MQL4 code, the one in a single .mq5 file is a rewrite for MQL5.
If I give some value in TP,SL it's working perfect. But sometimes when I try to changed TP,SL to 0 It's not working.. I could not find where it's checking TP or SL >0..

Kind Regards
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
If I give some value in TP,SL it's working perfect. But sometimes when I try to changed TP,SL to 0 It's not working.. I could not find where it's checking TP or SL >0..

Kind Regards
Which of the two scripts did you try? Is there any output in the Experts/Journal tabs when it isn't working?
 
  • 👍
Reactions: EnrichWave

EnrichWave

Master Trader
May 15, 2018
325
82
74
India
I checked on both files. mql4 conversion and rewritten to Mq5 file.
When I load the script with value 0 that showed like
Scripts script Modify_All_TP_SL(1) (XAUUSD,H4) loaded successfully
Scripts script Modify_All_TP_SL(1) (XAUUSD,H4) removed

but when I used the scripts with some value It showed like
Scripts script Modify_All_TP_SL(1) (XAUUSD,H1) loaded successfully
Trades 'xxxxxxxxxx': modify order #933373 sell limit 0.01 XAUUSD at 1478.95 sl: 0.00 tp: 0.00 -> 1478.95, sl: 1485.00 tp: 0.00
Trades 'xxxxxxxxxx': accepted modify order #933373 sell limit 0.01 XAUUSD at 1478.95 sl: 0.00 tp: 0.00 -> 1478.95, sl: 1485.00 tp: 0.00
Trades 'xxxxxxxxxx': modify #933373 sell limit 0.01 XAUUSD -> price: 1478.95, sl: 1485.00, tp: 0.00) done in 240.009 ms
Trades 'xxxxxxxxxx': modify #933606 sell 0.01 XAUUSD sl: 0.00, tp: 0.00 -> sl: 1485.00, tp: 0.00
Trades 'xxxxxxxxxx': accepted modify #933606 sell 0.01 XAUUSD sl: 0.00, tp: 0.00 -> sl: 1485.00, tp: 0.00
Trades 'xxxxxxxxxx': modify #933606 sell 0.01 XAUUSD -> sl: 1485.00, tp: 0.00 done in 223.527 ms
Trades 'xxxxxxxxxx': modify #933371 sell 0.01 XAUUSD sl: 0.00, tp: 0.00 -> sl: 1485.00, tp: 0.00
Trades 'xxxxxxxxxx': accepted modify #933371 sell 0.01 XAUUSD sl: 0.00, tp: 0.00 -> sl: 1485.00, tp: 0.00
Trades 'xxxxxxxxxx': modify #933371 sell 0.01 XAUUSD -> sl: 1485.00, tp: 0.00 done in 215.955 ms
Scripts script Modify_All_TP_SL(1) (XAUUSD,H1) removed
 

EnrichWave

Master Trader
May 15, 2018
325
82
74
India
Dude., I removed that line too.. but it seems it checks that somewhere..
may be "OrderTakeProfit()" or "OrderOrderStopLoss()" may have that check. I tried to find where that functions.. I could not find it even in "KimIVtoMT5.mqh".

Kind Regards
 

hedd

Newbie
Jan 6, 2020
6
0
1
78
Being a "newbie" probably doesnt help , but your PSC most certainly will! Thank you for your product Enivid. Some guidance would help please:

I have downloaded both the Script and PSC Indi (Ver 2.27), but I just can't seem to get the Script to activate trades.

Your help to get the script processing would be greatly appreciated. Thank you.
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
Being a "newbie" probably doesnt help , but your PSC most certainly will! Thank you for your product Enivid. Some guidance would help please:

I have downloaded both the Script and PSC Indi (Ver 2.27), but I just can't seem to get the Script to activate trades.

Your help to get the script processing would be greatly appreciated. Thank you.
Did you install the PSC-Trader script into the Scripts folder? Did it compile? Do you run it when the Position Size Calculator is on the chart? What messages does it output in the Experts tab of your Terminal subwindow?
 

hedd

Newbie
Jan 6, 2020
6
0
1
78
Thank you for your prompt reply Enivid. I had difficulty compiling the script but I did go thro compile process picking up the mq4 file from the script folder as the Screen Shot attached (which shows relevant comments in Experts Tab and PSC open on the Chart). I hope this is of assistance?
 

Attachments

  • Screenshot 2020-01-07 19.50.35 Re PSC Script Query.jpg
    Screenshot 2020-01-07 19.50.35 Re PSC Script Query.jpg
    242.1 KB · Views: 5

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
Thank you for your prompt reply Enivid. I had difficulty compiling the script but I did go thro compile process picking up the mq4 file from the script folder as the Screen Shot attached (which shows relevant comments in Experts Tab and PSC open on the Chart). I hope this is of assistance?
Please make a screenshot of the Experts tab after you try to launch PSC-Trader.

PS: However, I believe the problem is in the fact that your AutoTrading is disabled. Please enable it for the script to work.
 

hedd

Newbie
Jan 6, 2020
6
0
1
78
Please find attached Screenshot as requested
 

Attachments

  • Screenshot 2020-01-07 20.39.14 Re PSC Script Query.jpg
    Screenshot 2020-01-07 20.39.14 Re PSC Script Query.jpg
    257.4 KB · Views: 4
Status
Not open for further replies.