trading a currency pair X/Y while account base currency is Z - how does it work?

 

Hi guys

I just got a new trading account which has a different base currency to the pair I want to trade. For instance, if I have a USD based account but i trade GBP/JPY, or some other pair which doesnt contain USD, how is the order executed?

Does the broker automatically do a USD to (GBP or JPY) trade first, and then execute the GBP/JPY trade? If so, doesnt this mean that its nearly impossible to accurately set stop losses/limit profits for the pair because of underlying change in value of the initial USD/GBP trade? Because if you set a SL/TP on GBP/JPY, but USD/GBP plummets dramatically, the overall profit/loss of the trade may totally exceed what you 'expected'..? Or am I thinking about it wrong?

 
You've got it spot on, except the part about it being nearly impossible to set stops and limits. It is certainly more complicated. USD is second only to gold in terms of its stability, however. When you have the advantage of USD as a base currency, why not use it? Trade GBPUSD and USDJPY if you are interested in those currencies.
 

Thanks for the response anomalous

I was using those pairs for ease of read on the site - in reality my situation is more complicated, my account balance is actually linked to depersonalised metals account with different proportions of metals. fortunately I have an MT4 synthetic pair to show the conversion rate so I can still figure out my 'real' balance (post-withdrawal).

I trade XAG/XAU pretty much exclusively for now. So I am forced with this particular account to do (base currency) -> XAG or XAU pairs. So I dont have a choice. (i've got a standard USD accnt for XAG-XAU/USD pairs but im trying this new account for certain reasons)

So anyways, because i trade metals and my base currency is metal which has its own rate against USD, theres an almost doubling-to-exponential trend. If I have an open order on XAU or XAG and the market tends bullish, the DMA rate (being metal biased) will tend up, as will the price of the metal, causing more effective gains. (this is fine with me - i'm more worried about when it goes short!)

Any ideas how I might better arm myself against trading this way?

 

https://www.mql5.com/en/forum/132489

You have it correct, in the "big picture" you cannot rely on a specific fixed stoploss price as capturing your total Value at Risk (VaR) of loss when dealing with a cross-currency pair.

You have to setup your EA to continually monitor the existing VaR and adjusted the stoploss price accordingly.

 
Put your stops where they technically belong. Decide how much value you want to risk. Lot size = value/{pointValue*(open-stop)}.
//+------------------------------------------------------------------+
//| Lot size computation.                                            |
//+------------------------------------------------------------------+
void    OnInitLotSize(){
    at.risk.equity = 0; at.risk.total = 0;  at.risk.chart = 0;  }
double  LotSize(double risk){
/*double    at.risk.new;                        // Export to init/start
//double    TEF.value,                          // Import from ComputeTEF
//          at.risk.equity                      // \  Import from
//double    at.risk.chart,      at.risk.total;  // _> ModifyStops
//int       op.code; // OP_BUY/OP_SELL          // Import from SetDIR */
    /* This function computes the lot size for a trade.
     * Explicit inputs are SL relative to bid/ask (E.G. SL=30*points,)
     * Implicit inputs are the MM mode, the MM multiplier, count currently
     * filled orders by all EA's vs this EA/pair/period count and history.
     * Implicit inputs are all used to reduce available balance the maximum
     * dollar risk allowed. StopLoss determines the maximum dollar risk possible
     * per lot. Lots=maxRisk/maxRiskPerLot
     **************************************************************************/
    /*++++ Compute lot size based on account balance and MM mode*/{
    double  ab  = AccountBalance() - at.risk.equity;
    switch(MM.Fix0.Mod1.Geo2){
    case MMMODE_FIXED:                                              double
        perChrt = MM.PerChart,
        maxRisk = MM.MaxRisk;
        break;
    case MMMODE_MODERATE:
        // See https://www.mql5.com/en/articles/1526 Fallacies, Part 1: Money
        // Management is Secondary and Not Very Important.
        maxRisk = MathSqrt(MM.MaxRisk  * ab);
        perChrt = MathSqrt(MM.PerChart * ab);
        break;
    case MMMODE_GEOMETRICAL:
        perChrt = MM.PerChart * ab;
        maxRisk = MM.MaxRisk  * ab;
        break;
    }
    ComputeTEF();
    double  minLot  = MarketInfo(Symbol(), MODE_MINLOT),
            lotStep = MarketInfo(Symbol(), MODE_LOTSTEP),
            perLotPerPoint  = PointValuePerLot(),
            maxLossPerLot   = (risk+Slippage.Pips*pips2dbl) * perLotPerPoint,
            size = perChrt / maxLossPerLot; // Must still round to lotStep.
    /*---- Compute lot size based on account balance and MM mode*/}
    /* The broker doesn't care about the at.risk/account balance. They care
     * about margin. Margin used=lots used*marginPerLot and that must be less
     * than free margin available. Using the lesser of size vs
     * AccountFreeMargin / MODE_MARGINREQUIRED should have been sufficient, but
     * the tester was generating error 134 even when marginFree should have been
     * OK. So I also use AccountFreeMarginCheck < 0 which agrees with the
     * tester. Reported at https://www.mql5.com/en/forum/128506
     *
     * Second problem, after opening the new order, if free margin then drops to
     * zero we get a margin call. In the tester, the test stops with: "EA:
     * stopped because of Stop Out" So I make sure that the free margin
     * after is larger then the equity risk so I never get a margin call. */
    string status = "SL>AE";                            // Assume size < minLot
    while (true){   // Adjust for broker, test for margin, combine with TEF...
        size = MathFloor(MathMax(0,size)/lotStep)*lotStep;
        at.risk.new = size * maxLossPerLot;             // Export for Comment
        if (size < minLot){ at.risk.new = 0;    EA.status = status; return(0); }

        /* at.risk.equity  += Direction( OrderType() )
         *                  * (OrderClosePrice()-OrderStopLoss())*perPoint;
         * Summed for all open orders.
         * at.risk.total is summed for all open orders below Break even.
         * at.risk.chart is summed for all open orders below BE, this pair/TF */
        if (at.risk.new+at.risk.chart > perChrt){           // one pair, one TF
            size = (perChrt-at.risk.chart)/maxLossPerLot;   // Re-adjust lotStep
            status = "MaxRisk";     continue;   }

        if (at.risk.new+at.risk.total > maxRisk){           // All charts
            size = (maxRisk-at.risk.total)/maxLossPerLot;
            status = "TotalRisk";   continue;   }

        double  AFMC    = AccountFreeMarginCheck(Symbol(), op.code, size),
                eRisk   = at.risk.equity + at.risk.new;
        if (AFMC*0.99 <= eRisk){
            size *= 0.95;   status = "Free Margin";
            continue;   }   // Prevent margin call if new trade goes against us.
        break;
    }
    if (TEF.Enable01>0){
        size = MathFloor(size*MathMin(1, TEF.value)/lotStep)*lotStep;
        if (oo.count == 0 && size < minLot) size = minLot;  // Not below min
        at.risk.new = size * maxLossPerLot;                 // Export for Comment
        if (size < minLot){ at.risk.new=0;  EA.status = "TEF = "+TEF.value;
                                                                    return(0); }
    }
    return(size);   // We're good to go.
}   // LotSize
double  PointValuePerLot() { // Value in 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://www.mql5.com/en/forum/127584 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.
}
 
WHRoeder:
Put your stops where they technically belong. Decide how much value you want to risk. Lot size = value/{pointValue*(open-stop)}.

How does this help the thread OP? The value at risk will change in time as the underlying currency pair that translates back to the account changes value. If you don't change your stops, dynamically, then you are not managing the equity at risk.
 
1005phillip:

How does this help the thread OP? The value at risk will change in time as the underlying currency pair that translates back to the account changes value. If you don't change your stops, dynamically, then you are not managing the equity at risk.


sounds kind of silly but perhaps an easier way to manage the risk would be to decide what proportion of the account balance i wanted to risk per trade. then, open the appropriate lot size, but totally ignore SL/TP and merely check if the actual profit as balance changes to some level. Though, this seems ultra-risky as there's no server-side SL/TP to protect me..
 
seravitae:


sounds kind of silly but perhaps an easier way to manage the risk would be to decide what proportion of the account balance i wanted to risk per trade. then, open the appropriate lot size, but totally ignore SL/TP and merely check if the actual profit as balance changes to some level. Though, this seems ultra-risky as there's no server-side SL/TP to protect me..

That's not managing risk, that's leaving yourself fully open to it.

You need to define your intended SL and TP based on technical analysis of the price action, define the amount of money you are willing to lose, that determines the position size to take. Then set your SL, this is risk management. Then for cross-pairs you need to actively monitor the required stoploss price which, when combined with the the existing position size, is to be adjusted to ensure that your net equity at risk is observed as best as possible.

You could leave the stops unchanged, but as you noted that can leave you vulnerable to losing more equity than you actually intended to risk on the trade. Hence the required monitoring (by EA of course) of the position and recalibration of the stoploss value itself.
 

Yeah

What about referencing by desired currency risk?

Ie, if i open the order with "seek to loose $100, seek to gain $200", and then back-calculate from $100 to work out the SL for the 'top-tier pair' based on the underlying rate. It's probably a bit safer, though, the broker-side SL will still need to be updated regularly, which means if MT4 crashes or net connection is lost, there's still the potential for progressing past the maximum risk.

This is trickier than I thought :)

 
seravitae:

Yeah

What about referencing by desired currency risk?

Ie, if i open the order with "seek to loose $100, seek to gain $200", and then back-calculate from $100 to work out the SL for the 'top-tier pair' based on the underlying rate. It's probably a bit safer, though, the broker-side SL will still need to be updated regularly, which means if MT4 crashes or net connection is lost, there's still the potential for progressing past the maximum risk.

This is trickier than I thought :)


It won't work unless the leverage is 1:1. The "base" currency is related to the cross-currency only by the extent of the leverage.

What you are supposed to do, to do it right (and this is how the professionals do it) is you are supposed to hedge out the counter-risk.

An example. Let's say you have a USD-denominated account and you wish to open a position in CADJPY. CADJPY is a symboltype of 3, meaning USD is the base to both the base and counter currency of the CADJPY pair.

As such, the value of the CADJPY position will vary as a function of the USDJPY price by a ratio that is exactly that of the leverage. If you are trading with 50:1 leverage then the CADJPY position value is only dependent on the USDJPY price in a 1:50 (2%) relation.

So let's say you open a long position of 10-lot position in CADJPY. Simultaneously you need to open a short position of 10*2% = 0.2 lots in USDJPY. (note you don't always hedge a long with a short for this, sometimes you need to hedge long on a long for the other symboltypes)

Now what happens is that to whatever extent the 0.2 lot USDJPY position gains or loses valuation while you hold the CADJPY position open, those gains and losses are exactly offset by gains or losses in your CADJPY position based on the cross-currency component itself.

The net change in value from holding a 10-lot CADJPY long plus a 0.2-lot USDJPY short is simply the value change of CADJPY itself. Now your price-based stoploss on CADJPY need not be adjusted, you set it based on the chart technicals. You set a loose guardband SL on the USDJPY, but you need this position to float in value until whatever time you close the CADJPY position (and then immediately close the USDJPY position).

This is the technically correct way to manage cross-currency positions. Because the exact ratio of position sizing for the hedging is a function of ratio, and because of broker lotsize granularity is fixed and the leverage for accounts is usually quite high (used to be 200:1) it was basically impractical for people to manage the hedge.

If you were looking to open a 0.1 lot posiiton in CADJPY for example on a mini-account with 100:1 leverage that would mean you needed to open a 0.001 lot position in USDJPY to hedge the price fluctuations of USDJPY on the CADJPY position. No broker is going to let you do that.

But if you are trading with lower leverage, 10:1, and on retail accounts where you have $50k or more and are looking at opening positions with 5 lots or 10 lots of CADJPY then it is very practical (and necessary) to open a 0.5 lot or 1 lot position in USDJPY to hedge the price activity.

 
  1. Lot size = value/{pointValue*(open-stop)}.
    This is your maximum risk to account balance.
  2. If you want to know the maximum risk to equity, sum for all open orders
    perLotPerPoint  = PointValuePerLot();
                eRisk   = (OrderClosePrice()-OrderStopLoss())
                        * Direction(OrderType())
                        * OrderLots() * perLotPerPoint;
    

Reason: