Skip to content

Commit

Permalink
2.34
Browse files Browse the repository at this point in the history
1. Added multiple TP lines and TP input fields on the Main tab when the ScriptTakePorfitsNumber input parameter is greater than 1.
2. Added additional SL label option to show risk above the stop-loss line. This can be helpful when the panel is minimized.
3. Added risk-to-reward ratio display to the additional TP label.
4. Added lot display for additional TP labels when multiple TP levels are in use.
5. Added Stop-loss button when default SL value is set via input parameters.
6. Added current symbol filter checkbox to the Risk tab.
7. Added automatic restoration of line objects if they get accidentally deleted.
8. Added helpful tooltips to relevant panel elements and lines.
9. Added a warning for cases when calculated position size is greater than the maximum position size possible with current free margin — position size becomes red.
10. MT5 wide format for 8 decimal places now kicks in only if either account balance or the chart symbol use so many decimal places.
11. PSC-Trader script will now correctly detect the status of the Disable trading when lines are hidden checkbox.
12. Fixed a bug in MT5 version that made the stop price line appear after input parameters change even if order type wasn't set to stop limit.
13. Fixed a bug in MT5 version that prevented the LinesSelected input parameter from working properly.
14. Fixed a bug in MT4 that resulted in invalid stop-loss values when SL in pips was used and the chart's symbol switch occurred.
15. Fixed a bug in MT5 that resulted in some panel fields to appear when a chart timeframe was switched on a minimized panel in the locked take-profit mode.
16. Fixed potential 'division by zero' errors when chart data isn't ready.
  • Loading branch information
EarnForex authored Mar 20, 2021
1 parent f42c3f1 commit 98d4b38
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
Binary file modified MQL4/Indicators/PositionSizeCalculator/Defines.mqh
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 5 additions & 4 deletions MQL4/Scripts/PSC-Trader.mq4
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//+------------------------------------------------------------------+
//| PSC-Trader.mq4 |
//| Copyright 2015-2020, EarnForex.com |
//| Copyright 2015-2021, EarnForex.com |
//| https://www.earnforex.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015-2020, EarnForex.com"
#property copyright "Copyright 2015-2021, EarnForex.com"
#property link "https://www.earnforex.com/metatrader-indicators/Position-Size-Calculator/#Trading_script"
#property version "1.10"
#property version "1.11"
#property strict
#include <stdlib.mqh>

Expand Down Expand Up @@ -186,7 +186,7 @@ void OnStart()
Print("Order commentary = ", Commentary);

// Checkbox for disabling trading when hidden lines
string ChkDisableTradingWhenLinesAreHidden = FindObjectByPostfix("m_ChkDisableTradingWhenLinesAreHiddenButton", OBJ_EDIT);
string ChkDisableTradingWhenLinesAreHidden = FindObjectByPostfix("m_ChkDisableTradingWhenLinesAreHiddenButton", OBJ_BITMAP_LABEL);
if (ChkDisableTradingWhenLinesAreHidden != "") DisableTradingWhenLinesAreHidden = ObjectGetInteger(0, ChkDisableTradingWhenLinesAreHidden, OBJPROP_STATE);
Print("Disable trading when lines are hidden = ", DisableTradingWhenLinesAreHidden);

Expand Down Expand Up @@ -413,6 +413,7 @@ void OnStart()
}
double steps = 0;
if (LotStep != 0) steps = position_size / LotStep;
if (MathAbs(MathRound(steps) - steps) < 0.00000001) steps = MathRound(steps);
if (MathFloor(steps) < steps)
{
position_size = MathFloor(steps) * LotStep;
Expand Down
Binary file modified MQL5/Indicators/PositionSizeCalculator/Defines.mqh
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions MQL5/Scripts/PSC-Trader.mq5
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//+------------------------------------------------------------------+
//| PSC-Trader.mq5 |
//| Copyright 2015-2020, EarnForex.com |
//| Copyright 2015-2021, EarnForex.com |
//| https://www.earnforex.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015-2020, EarnForex.com"
#property copyright "Copyright 2015-2021, EarnForex.com"
#property link "https://www.earnforex.com/metatrader-indicators/Position-Size-Calculator/#Trading_script"
#property version "1.10"
#property version "1.11"
#include <Trade/Trade.mqh>

/*
Expand Down Expand Up @@ -206,7 +206,7 @@ void OnStart()
Print("Order commentary = ", Commentary);

// Checkbox
string ChkDisableTradingWhenLinesAreHidden = FindObjectByPostfix("m_ChkDisableTradingWhenLinesAreHiddenButton", OBJ_EDIT);
string ChkDisableTradingWhenLinesAreHidden = FindObjectByPostfix("m_ChkDisableTradingWhenLinesAreHiddenButton", OBJ_BITMAP_LABEL);
if (StringLen(ChkDisableTradingWhenLinesAreHidden) > 0) DisableTradingWhenLinesAreHidden = ObjectGetInteger(0, ChkDisableTradingWhenLinesAreHidden, OBJPROP_STATE);
Print("Disable trading when lines are hidden = ", DisableTradingWhenLinesAreHidden);

Expand Down

0 comments on commit 98d4b38

Please sign in to comment.