MQL4 and MQL5 modification suggestion

 

I would like to request the following items be incorporated into MT products.

1. Price Per Point value - in the event the coder wants to know on the fly how much it would cost on a particular chart from a particular vendor given the client currency and the charts currency. So a function PricePerPoint() woudl return a reliable numeric value of the chart involved at the time.

2. Identification of Anti-hedging policy for the current client - IsAHedge() returns a bool indicating that the client account requires the Anti-hedging policy support.

3. Indentification of FIFO - sames as Anit-Hedging IsFIFO() returns a bool indicating user is bound by FIFO policy.

4. GetFirst or GetLast - This is mostly for GetLast as in GetLastClosedTrade from Trade History, or from open trades. Yes I know there is code on the forum to do it, but it would be a good idea to put this sort of thing into the MT product. Kind of like accessing the C# method of getting to the First, Last, Previous and Next records of an array or list. This kind of control would be nice when going through the open trades or the history of trades.

5. Better MT4 controls over the MT4 like what we have in MT5. The idea of being able to open charts, close charts, change properties on charts, force EAs onto charts, etc. This is a strong avenue to make life simpler for the user, which in turn shortens the tech support time for a EA developer.

In summary, for the most part, when the policies came out and we were told that we could continue as it without worry, this wasn't fully accurate. Now it is an issue like determining if a client is an ECN, or determining if the point is 4 digit or 5 digit. The thought here is that we should be focused on how to get the trades to function properly according to the designed strategies not so much about how to get to the data that helps us to identify whether a client is special because their broker wants to be special. This should be a simple bool function that returns a true = broker is ECN, broker is special, so perform a special way of handling the code.

Even better, MT should identify that the broker is special (ECN) and handle the extra digit conditions like breaking down an ordersend and sending it in the OrderSend and OrderModify for us. It might be a good idea to handle the FIFO conditions as well or any other "I am a special broker so I wan to make special policies" conditions that are laid out.

Sorry I just think things like this should be handled in the lower levels of the code and not cost developer time over and over again to address the issues each time someone wants their clients to be handled and treated special.

This is not to knock the ECN, I personally support ECN, it is just a lot of exess coding that could be handled in the lower levels of the build process.

 
  1. LEHayes:

    1. Price Per Point value - in the event the coder wants to know on the fly how much it would cost on a particular chart from a particular vendor given the client currency and the charts currency. So a function PricePerPoint() woudl return a reliable numeric value of the chart involved at the time.

    double PointValuePerLot() { // Value in the account currency of a Point of Symbol.
        /* In tester I had a sale: open=1.35883 close=1.35736 (0.00147)
         * gain$=97.32/6.62 lots/147 points=$0.10/point or $1.00/pip.
         * IBFX demo/mini       EURUSD TICKVALUE=0.1 MAXLOT=50 LOTSIZE=10,000
         * IBFX demo/standard   EURUSD TICKVALUE=1.0 MAXLOT=50 LOTSIZE=100,000
         *                                  $1.00/point or $10.00/pip.
         *
         * https://forum.mql4.com/33975 CB: MODE_TICKSIZE will usually return the
         * same value as MODE_POINT (or Point for the current symbol), however, an
         * example of where to use MODE_TICKSIZE would be as part of a ratio with
         * MODE_TICKVALUE when performing money management calculations which need
         * to take account of the pair and the account currency. The reason I use
         * this ratio is that although TV and TS may constantly be returned as
         * something like 7.00 and 0.00001 respectively, I've seen this
         * (intermittently) change to 14.00 and 0.00002 respectively (just example
         * tick values to illustrate). */
        return(  MarketInfo(Symbol(), MODE_TICKVALUE)
               / MarketInfo(Symbol(), MODE_TICKSIZE) ); // Not Point.
    }
    
    double maxLossPerLot = SLpoints * PointValuePerLot(),
  2. LEHayes:

    or determining if the point is 4 digit or 5 digit.

    //++++ These are adjusted for 5 digit brokers.
    double  pips2points,    // slippage  3 pips    3=points    30=points
            pips2dbl;       // Stoploss 15 pips    0.0015      0.00150
    int     Digits.pips;    // DoubleToStr(dbl/pips2dbl, Digits.pips)
    int init(){
        if (Digits == 5 || Digits == 3){    // Adjust for five (5) digit brokers.
                    pips2dbl    = Point*10; pips2points = 10;   Digits.pips = 1;
        } else {    pips2dbl    = Point;    pips2points =  1;   Digits.pips = 0; }
        // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl
    
 
WHRoeder:
  1. double maxLossPerLot = SLpoints * PointValuePerLot()

Only valid for currency pairs whose counter-currency is the account's denomination. (EURUSD if account is USD-based, EURGBP if account is GBP-based, etc)
Reason: