30% Margin Call line indicator

 

Hi

Can anyone do indicator what calculates based on open orders Price where Free Margin gonna hit 30%?

I think it should give two prices if i have multiple buy and sell orders open.

 
You'll have to learn to code for that one buddy. Or hey maybe you could Pay someone to code it and then you could share it.
 

I know simple mql4 coding. So maybe anywone can tell how this Free Margin % is exactly calculated with leverage.

For example if i have 1:50 leverage and i buy 0.01 lot of EURUSD.

Buy the way i am playing at http://www.admiralmarkets.ee/

EURUSD SPREAD ONLY 1pip at local daytime, very good for sculping.

 
tarmo1979:
I know simple mql4 coding. So maybe anywone can tell how this Free Margin % is exactly calculated with leverage.
Think about this
    for(iPos = OrdersTotal() - 1; iPos >= 0 ; iPos--) if (
    OrderSelect(iPos, SELECT_BY_POS) ){
        // All charts, not just my chart, no SetDIR here.
        double  DIRorder    = Direction( OrderType() );
        perLotPerPoint      = PointValuePerLot( OrderSymbol() );
        // Max loss to balance due to all charts
        eRisk   = (OrderOpenPrice()-OrderStopLoss()) * DIRorder;
        // Max loss to equity due to all charts
        eRisk   = (OrderClosePrice()-OrderStopLoss()) * DIRorder;
        equity.at.risk += eRisk * OrderLots() * perLotPerPoint;
    }   // For OrderSelect
    if (oo.count > 0){
        double AFM = AccountFreeMargin();           // This condition will
        if (AFM < equity.at.risk){                  // allow a margin call.
:
double  PointValuePerLot(string pair=""){
    /* Value in account currency of a Point of Symbol.
     * In tester I had a sale: open=1.35883 close=1.35736 (0.0147)
     * 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.0/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.0001 respectively, I've seen this
     * (intermittently) change to 14.00 and 0.0002 respectively (just example
     * tick values to illustrate).
     * https://forum.mql4.com/43064#515262 zzuegg reports for non-currency DE30:
     * MarketInfo(Symbol(),MODE_TICKSIZE) returns 0.5
     * MarketInfo(Symbol(),MODE_DIGITS) return 1
     * Point = 0.1
     * Prices to open must be a multiple of ticksize */
    if (pair == "") pair = Symbol();
    return(  MarketInfo(pair, MODE_TICKVALUE)
           / MarketInfo(pair, MODE_TICKSIZE) ); // Not Point.
}
double  Direction(int op_xxx){  return( 1. - 2. * (op_xxx%2) );                }
 
This explains free margins. And Here.
 

Доброго времени суток уважаемые форумчане!

Меня зовут Герман, мне 23 года, я являюсь трейдером компании "Инстафорекс"

Помогите в поиске нужного скрипта! Скрипт нужен для сетки отложенных ордеров.

Reason: