Basado en la estrategia "Div hunter"

 

Pensé que cuando se detiene el comercio en SPOT, esto se puede usar bastante

estrategia de riesgo (Fut Gap). Su significado es que no compramos acciones , sino que solo vendemos futuros.

con el Gap creado por nosotros.

Cuando se negocian acciones, calculamos el delta promedio entre los futuros y las acciones, y cuando

ha finalizado la negociación de acciones, colocamos una orden (órdenes) para la venta de futuros (delta calculado + nuestro Gap).

Y en la mañana vendemos futuros

(la pregunta es ¿cómo vender si la posición es lo suficientemente grande?).


 //+------------------------------------------------------------------+
//|                                                      Fut_gap.mq5 |
//|                                     Copyright 2019, prostotrader |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, prostotrader"
#property link        "https://www.mql5.com"
#property version    "1.00"
//---
#include   "AutoMagic.mqh"
//--
input long PrGap        = 100 ;         //Гап вверх(пункты)
input string DeltaStart = "10:00:00" ; //Время начала расчета дельты
input string DeltaEnd   = "18:38:00" ; //Время конца расчета дельты
input string ClirStart  = "14:00:00" ; //Время начала дневного клиринга
input string ClirEnd    = "14:05:00" ; //Время конца клиринга
input string OrderStart = "19:05:00" ; //Время начала установки ордера
input string OrderEnd   = "23:43:00" ; //Время конца установки ордера
input long   PosMax     = 100 ;         //Максимальное кол-во контрактов
input long   PosEnter   = 5 ;           //Контрактов в ордере
//--- Variables
string fut_symbol, spot_symbol;
bool fut_book, spot_book;
enum POS_STATE
{
  POS_UNKNOWN = - 1 ,
  POS_NONE    = 0 ,
  POS_LONG    = 1 ,
  POS_SHORT   = 2
};
enum TIME_STATE
{
  TIME_UNKNOWN     = - 1 ,
  TIME_DELTA       = 0 ,
  TIME_CLIRING     = 1 , 
  TIME_ORDER       = 2 ,
  TIME_OUT_SESSION = 3
};
enum ENUM_ORD_STATE
{
  ORD_NO_STATE  = 0 ,
  ORD_DO_SET    = 1 ,
  ORD_DO_MODIFY = 2 ,
  ORD_WORK      = 3 ,
  ORD_DO_CANCEL = 4
};
struct EXP_DATA
{
   double contr_size;
   ulong delta_cnt;
   double fut_buy;
   double spot_sell;
   double spot_last;
   long contr_cnt;
   double delta_midle; 
   int spot_digits;
  TIME_STATE time_state;
   ulong st_delta_value;
   ulong end_delta_value;
   ulong st_clir_value;
   ulong end_clir_value;
   ulong st_order_value;
   ulong end_order_value;
  POS_STATE pos_state;
   double step_price;
   ulong ticket;
   ulong req_id;
   ulong magic;
  ENUM_ORD_STATE ord_state;
};
EXP_DATA exp_data;
//+------------------------------------------------------------------+
//| Expert Set Time values function                                  |
//+------------------------------------------------------------------+
ulong SetTimeValue( const string in_str)
{
   int str_size = StringLen (in_str);
   if (str_size == 8 )
  {
     int k = StringFind (in_str, ":" , 2 );
     if (k == 2 )
    {
       string s_hour = StringSubstr (in_str, 0 , k);
      k = StringFind (in_str, ":" , 5 );
       if (k == 5 )
      {
         string s_min = StringSubstr (in_str, 3 , k- 3 );
         string s_sec = StringSubstr (in_str, 6 , str_size - k - 1 );
         ulong t_sec = ulong ( StringToInteger (s_sec));
         ulong t_min = ulong ( StringToInteger (s_min)) * 60 ;
         ulong t_hour = ulong ( StringToInteger (s_hour)) * 3600 ;
         return (t_hour + t_min + t_sec);
      }
    }
  }
   return ( 0 );
}
//+------------------------------------------------------------------+
//| Expert Get Spot name function                                    |
//+------------------------------------------------------------------+
string GetSpot( const string fut_name)
{
   string Spot = "" ; 
   if (fut_name != "" )
  {
     int str_tire = StringFind (fut_name, "-" );
     if (str_tire > 0 )
    {
      Spot = StringSubstr (fut_name, 0 , str_tire);
       if (Spot == "GAZR" ) Spot = "GAZP" ; else
       if (Spot == "SBRF" ) Spot = "SBER" ; else
       if (Spot == "SBPR" ) Spot = "SBERP" ; else
       if (Spot == "TRNF" ) Spot = "TRNFP" ; else
       if (Spot == "NOTK" ) Spot = "NVTK" ; else
       if (Spot == "MTSI" ) Spot = "MTSS" ; else
       if (Spot == "GMKR" ) Spot = "GMKN" ; else
       if (Spot == "SNGR" ) Spot = "SNGS" ; else
       if (Spot == "Eu" )   Spot = "EURRUB_TOD" ; else
       if (Spot == "Si" )   Spot = "USDRUB_TOD" ; else
       if (Spot == "SNGP" ) Spot = "SNGSP" ;
    }
  }  
   return (Spot);
}
//+------------------------------------------------------------------+
//| Expert Chek position function                                    |
//+------------------------------------------------------------------+
POS_STATE CheckPosState()
{
  exp_data.contr_cnt = 0 ;
   if ( PositionSelect (fut_symbol))
  {
    exp_data.contr_cnt =   long ( PositionGetDouble ( POSITION_VOLUME ));
     ENUM_POSITION_TYPE pos_type = ENUM_POSITION_TYPE ( PositionGetInteger ( POSITION_TYPE ));
     switch (pos_type)
    {
       case POSITION_TYPE_BUY :
         return (POS_LONG);
       break ;
       case POSITION_TYPE_SELL :
         return (POS_SHORT);
       break ;
    }
  }
   else return (POS_NONE);
   return (POS_UNKNOWN);
}
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit ()
{
  fut_symbol = Symbol ();
  spot_symbol = GetSpot(fut_symbol);
   if (spot_symbol == "" )
  {
     Alert ( "Не получено имя СПОТа!" );
     return ( INIT_FAILED );
  }
   else
  {
     if ( SymbolSelect (spot_symbol, true ) == false )
    {
       Alert ( "Нет смвола с именем " + spot_symbol + "!" );
       return ( INIT_FAILED );
    }
     else
    {
      spot_book = MarketBookAdd (spot_symbol);
       if (spot_book == false )
      {
         Alert ( "Не добавлен стакан СПОТа!" );
         return ( INIT_FAILED );
      }
    }
  } 
  fut_book = MarketBookAdd (fut_symbol);
   if (fut_book == false )
  {
     Alert ( "Не добавлен стакан фьючерса!" );
     return ( INIT_FAILED );
  }
//---
  exp_data.pos_state = CheckPosState();  
  exp_data.delta_cnt = 0 ;
  exp_data.fut_buy = 0 ;
 // exp_data.fut_sell = 0;
 // exp_data.spot_buy = 0;
  exp_data.spot_sell = 0 ;
  exp_data.spot_digits = int ( SymbolInfoInteger (spot_symbol, SYMBOL_DIGITS ));
  exp_data.spot_last = SymbolInfoDouble (spot_symbol, SYMBOL_LAST );
  exp_data.delta_midle = 0 ;
  exp_data.step_price = SymbolInfoDouble (fut_symbol, SYMBOL_TRADE_TICK_SIZE );
  exp_data.contr_size = SymbolInfoDouble (fut_symbol, SYMBOL_TRADE_CONTRACT_SIZE );
  exp_data.st_delta_value = SetTimeValue(DeltaStart);
  exp_data.end_delta_value = SetTimeValue(DeltaEnd);
  exp_data.st_clir_value = SetTimeValue(ClirStart);
  exp_data.end_clir_value = SetTimeValue(ClirEnd);
  exp_data.st_order_value = SetTimeValue(OrderStart);
  exp_data.end_order_value = SetTimeValue(OrderEnd);
//---
   if ((exp_data.st_delta_value > 0 ) && (exp_data.end_delta_value > 0 ) &&
     (exp_data.st_clir_value > 0 ) && (exp_data.end_clir_value > 0 ) &&
     (exp_data.st_order_value > 0 ) && (exp_data.end_order_value > 0 ))
  {
    exp_data.magic = GetMagic(fut_symbol);
     if (exp_data.magic == 0 ) 
    {
       Alert ( "Не установлен магик!" );
       return ( INIT_FAILED );
    }
     return ( INIT_SUCCEEDED );
  }
   else return ( INIT_FAILED );
}
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit ( const int reason)
{
   if (fut_book == true ) MarketBookRelease (fut_symbol);
   if (spot_book == true ) MarketBookRelease (spot_symbol);
   if (reason == REASON_INITFAILED )
  {
     Print ( "Эксперт удалён! Причина - ошибка инициализации." );
     ExpertRemove ();
  }
}
//+------------------------------------------------------------------+
//| Expert Check Trade Time function                                 |
//+------------------------------------------------------------------+
TIME_STATE CheckTradeTime()
{
   MqlDateTime dt_str;
   TimeTradeServer (dt_str);
   if (dt_str.year > 0 )
  {
     ulong cur_time = ulong (dt_str.sec) + ulong (dt_str.min * 60 ) + ulong (dt_str.hour * 3600 );
     if ((cur_time >= exp_data.st_delta_value) && (cur_time <= exp_data.end_delta_value))
    {
       return (TIME_DELTA);
    }
     else
    {
       if ((cur_time >= exp_data.st_clir_value) && (cur_time <= exp_data.end_clir_value))
      {
         return (TIME_CLIRING);
      }
       else
      {
         if ((cur_time >= exp_data.st_order_value) && (cur_time <= exp_data.end_order_value))
        {
           return (TIME_ORDER);
        }
         else return (TIME_OUT_SESSION);
      }
    }
  }
   return (TIME_UNKNOWN);
}
//+------------------------------------------------------------------+
//| Expert Points to price function                                  |
//+------------------------------------------------------------------+
double PointsToPrice( const long a_points)
{
   double a_price = ( double (a_points) * Point () ) / exp_data.step_price;
   if (a_points < 0 )
  {
    a_price = MathFloor (a_price) * exp_data.step_price;
  }
   else
  {
    a_price = MathCeil (a_price) * exp_data.step_price;
  }
   return ( NormalizeDouble (a_price, Digits ()));
}
//+------------------------------------------------------------------+
//| Expert Set Delta Value function                                  |
//+------------------------------------------------------------------+
void SetDeltaValue()
{
  exp_data.fut_buy = SymbolInfoDouble (fut_symbol, SYMBOL_BID );
  exp_data.spot_sell = SymbolInfoDouble (spot_symbol, SYMBOL_ASK );
   if ((exp_data.fut_buy > 0 ) && (exp_data.spot_sell > 0 ))
  {
     double cur_delta = (exp_data.fut_buy - exp_data.spot_sell * exp_data.contr_size);
     double tmp_delta = exp_data.delta_midle * exp_data.delta_cnt;
    exp_data.delta_cnt++;
    exp_data.delta_midle = (tmp_delta + cur_delta)/exp_data.delta_cnt;
  }
}
//+------------------------------------------------------------------+
//| Expert Place Order function                                      |
//+------------------------------------------------------------------+
bool PlaceOrder( const long volume)
{
   if ((exp_data.delta_cnt > 0 ) && (exp_data.delta_midle > 0 ))
  {
    exp_data.spot_last = SymbolInfoDouble (spot_symbol, SYMBOL_LAST ); 
     long delta = long (exp_data.delta_midle/Point());
     double price = exp_data.spot_last * exp_data.contr_size + PointsToPrice(delta + PrGap); 
     double max_price = SymbolInfoDouble (fut_symbol, SYMBOL_SESSION_PRICE_LIMIT_MAX );
     double min_price = SymbolInfoDouble (fut_symbol, SYMBOL_SESSION_PRICE_LIMIT_MIN );
     if ((price >= min_price) && (price <= max_price))
    {
       MqlTradeRequest request = { 0 };
       MqlTradeResult   result  = { 0 };
      exp_data.ticket = 0 ;
      exp_data.req_id = 0 ;
      request.action = TRADE_ACTION_PENDING ;
      request.magic  = exp_data.magic;
      request.symbol = fut_symbol;
      request.volume = double (volume);
      request.price  = price;
      request.type = ORDER_TYPE_SELL_LIMIT ;
      request.comment = "Отложенный ордер..." ;      
      request.type_filling = ORDER_FILLING_RETURN ;
      request.type_time = ORDER_TIME_DAY ;
//--- Send order
       if ( OrderSendAsync (request, result) == true )
      {
         if ((result.retcode == TRADE_RETCODE_PLACED ) || (result.retcode == TRADE_RETCODE_DONE )) 
        {
          exp_data.req_id = result.request_id;
           if (exp_data.req_id > 0 ) exp_data.ord_state = ORD_DO_SET;
        }
         else
        {
           Print (result.retcode, "; PleceOrder: Ордер не установлен!" );
        }
      }
       else
      {
         Print (result.retcode, "; PlaceOrder: Ордер не отослан!" );
      }
    }
  }
   return ( false );
}
//+------------------------------------------------------------------+
//| Expert Set Order function                                         |
//+------------------------------------------------------------------+
void SetOrder( const double o_vol, const bool buy_sell)
{
   MqlTradeRequest request = { 0 };
   MqlTradeResult   result  = { 0 };
  exp_data.req_id = 0 ;
  exp_data.ticket = 0 ;
//--- Fill structure
  request.magic = exp_data.magic;
  request.symbol = fut_symbol;
  request.volume = o_vol; 
  request.type_filling = ORDER_FILLING_IOC ;
  request.type_time = ORDER_TIME_DAY ;
  request.action = TRADE_ACTION_DEAL ;
  request.comment = "Рыночный ордер..." ;
   if (buy_sell == true )
  {
    request.type = ORDER_TYPE_BUY ;
  }
   else
  {
    request.type = ORDER_TYPE_SELL ;
  }
//--- Send order
   if ( OrderSendAsync (request, result))
  {
     if ((result.retcode == TRADE_RETCODE_PLACED ) || (result.retcode == TRADE_RETCODE_DONE ))
    {
      exp_data.req_id = result.request_id;
       if (exp_data.req_id > 0 ) exp_data.ord_state = ORD_DO_SET;  
    }
     else
    {
       Print (result.retcode, "; SetOrder: Ордер не установлен!" );
    }
  }
   else
  {
     Print (result.retcode, "; SetOrder: Ордер не отправлен!" );
  }
}
//+------------------------------------------------------------------+
//| Expert Close position function                                   |
//+------------------------------------------------------------------+
void RemoveOrder()
{
  exp_data.req_id = 0 ;
   MqlTradeRequest request = { 0 };
   MqlTradeResult   result  = { 0 };
  request.action = TRADE_ACTION_REMOVE ;
  request.order = exp_data.ticket;
   if ( OrderSendAsync (request, result) == true )
  {
     if ((result.retcode == TRADE_RETCODE_PLACED ) || (result.retcode == TRADE_RETCODE_DONE ))
    { 
      exp_data.req_id = result.request_id;
       if (exp_data.req_id > 0 ) exp_data.ord_state = ORD_DO_CANCEL;
    }
  }
   else
  {
     Print (result.retcode, "; RemoveOrder: Ордер не отослан!" );
  }
}
//+------------------------------------------------------------------+
//| Expert Close position function                                   |
//+------------------------------------------------------------------+
void ClosePosition()
{
   if ( PositionSelect (fut_symbol))
  {
     double a_vol = PositionGetDouble ( POSITION_VOLUME );
     ENUM_POSITION_TYPE pos_type = ENUM_POSITION_TYPE ( PositionGetInteger ( POSITION_TYPE ));
     switch (pos_type)
    {
       case POSITION_TYPE_BUY :
        SetOrder(a_vol, false ); //Sell order
       break ;
       case POSITION_TYPE_SELL :
        SetOrder(a_vol, true );   //Buy order
       break ;     
    }
  }
}
//+------------------------------------------------------------------+
//| Expert Book Event function                                       |
//+------------------------------------------------------------------+
void OnBookEvent ( const string &symbol)
{
   if ((symbol == fut_symbol) || (symbol == spot_symbol))
  {
    exp_data.pos_state = CheckPosState();
     if (exp_data.ord_state == ORD_NO_STATE)
    {
       long a_vol;
       switch (CheckTradeTime())
      {
        case TIME_OUT_SESSION:
          exp_data.delta_midle = 0;
          exp_data.delta_cnt = 0;
        break;
         case TIME_DELTA:
           switch (exp_data.pos_state)
          {
             case POS_UNKNOWN:
             break ;
             case POS_NONE:
              SetDeltaValue();
             break ;
             case POS_LONG:       //Не верно открыта позиция
              ClosePosition();
             break ;
             case POS_SHORT:
              ClosePosition();   //Сразу закрывать позицию (10:00:00)??????? Всю или частями??????????
             break ;
          }
         break ;
         case TIME_ORDER:
           switch (exp_data.pos_state)
          {
             case POS_UNKNOWN:
             break ;
             case POS_NONE:
              PlaceOrder(PosEnter);
             break ;
             case POS_LONG:
              ClosePosition(); //Не верно открыта позиция
             break ;
             case POS_SHORT:   //Добавление позиции
              a_vol = PosMax - exp_data.contr_cnt;
               if (a_vol > 0 )
              {
                 if (a_vol > PosEnter) a_vol = PosEnter; 
                PlaceOrder(a_vol);
              }  
             break ;
          }
         break ;
      }
    }
     else
    {
       switch (exp_data.ord_state)
      {
         case ORD_DO_SET:
           //TODO
         break ;
         case ORD_DO_CANCEL:
           //TODO
         break ;
         case ORD_WORK:
           //TODO
         break ;
      } 
    }
  }
}
//+------------------------------------------------------------------+
//| TradeTransaction function                                        |
//+------------------------------------------------------------------+
void OnTradeTransaction ( const MqlTradeTransaction & trans,
                         const MqlTradeRequest & request,
                         const MqlTradeResult & result)
{
   switch (trans.type)
  {
     case TRADE_TRANSACTION_REQUEST :
       if ((exp_data.req_id > 0 ) && (result.request_id == exp_data.req_id))
      {
         if (result.order > 0 )
        {
          exp_data.ticket = result.order;
          exp_data.req_id = 0 ;
        }
         else
        {
          exp_data.ticket = 0 ;
          exp_data.req_id = 0 ;
          exp_data.ord_state = ORD_NO_STATE;
        }
      }
     break ;
     case TRADE_TRANSACTION_HISTORY_ADD :
       if ((exp_data.ticket > 0 ) && (trans.order == exp_data.ticket))
      {
        exp_data.ticket = 0 ;
        exp_data.req_id = 0 ;
        exp_data.ord_state = ORD_NO_STATE;
      }
     break ;
     case TRADE_TRANSACTION_ORDER_UPDATE :
       switch (trans.order_state)
      {
         case ORDER_STATE_PLACED :
           if ((exp_data.ticket > 0 ) && (trans.order == exp_data.ticket))
          {
             switch (exp_data.ord_state)
            {
               case ORD_DO_SET:
                exp_data.ord_state = ORD_WORK;
               break ;
            }
          }
         break ;
      }
     break ;  
  }   
}
//+------------------------------------------------------------------+

¡La demostración no funcionará!

Agregado

 //+------------------------------------------------------------------+
//|                                                    AutoMagic.mqh |
//|                                 Copyright 2017-2018 prostotrader |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
//version   "1.01
ulong symb_magic;
//-------------------------------------------------------------------+
// Split string function                                             |
//+------------------------------------------------------------------+
string SplitString( const string a_str, ulong &a_month, ulong &a_year)
  {
   int str_size= StringLen (a_str);
   int str_tire= StringFind (a_str, "-" );
   int str_tochka= StringFind (a_str, "." , str_tire);
   if ((str_tire> 0 ) && (str_tochka> 0 ) &&(str_size > 0 ))
     {
      a_month= ulong ( StringToInteger ( StringSubstr (a_str,str_tire+ 1 ,str_tochka-str_tire- 1 )));
      a_year = ulong ( StringToInteger ( StringSubstr (a_str,str_tochka+ 1 ,str_size-str_tochka- 1 )));
       if ((a_month > 0 ) && (a_year > 0 )) return ( StringSubstr (a_str, 0 , str_tire));
     }
   return ( "" );
  }
//-------------------------------------------------------------------+
// Get Magic function                                                |
//+------------------------------------------------------------------+
ulong GetMagic( const string a_symbol)
{
//--- Get ChartID
  symb_magic = 0 ;
   if ( SymbolSelect ( Symbol (), true ) == false )
  {
     Print ( __FUNCTION__ , ": Нет такого символа!" );
     return ( 0 );
  }
   ulong month = 0 ;
   ulong year = 0 ;
   string new_str = SplitString(a_symbol,month,year);
   if ( StringLen (new_str)> 0 )
  {
     uchar char_array[];
     int result= StringToCharArray (new_str,char_array, 0 , WHOLE_ARRAY , CP_ACP );
     if (result> 0 )
   {
     ulong value;
     for ( int i = 0 ; i < result - 1 ; i++)
     {
       value= ulong (char_array[i]);
       value<<=( 56 -(i* 8 ));
       symb_magic += value;
     }
     month<<= 24 ;
     symb_magic += month;
     year<<= 16 ;
     symb_magic += year;
     return (symb_magic);
   }
 }
   return ( 0 ); 
}
//-------------------------------------------------------------------+
// Is my magic function                                              |
//+------------------------------------------------------------------+
bool IsMyMagic( const ulong m_magic)
{
   if (m_magic > 0 )
  {
     ulong stored_magic=symb_magic;
    stored_magic>>= 16 ;
     ulong in_magic = m_magic;
    in_magic>>= 16 ;
     if (in_magic == stored_magic) return ( true );
  }  
   return ( false );
}
//-------------------------------------------------------------------+
// Get stored magic function                                         |
//+------------------------------------------------------------------+
ulong GetStoredMagic()
{
   if (symb_magic > 0 ) return (symb_magic);
   return ( 0 );  
}
//+------------------------------------------------------------------+
 

Por cierto, USDRUB_TOM podría ser un indicador para SBER y VTB .

Tengo que pensar cómo "atornillarlo" en mi EA...

Añadido

¿Nadie tiene alguna idea sobre cómo salir de una posición con gran volumen?

 
Sólo hay que añadir una función
void CheckOrderState()
Y decidir cómo cerrar una gran posición....
Archivos adjuntos:
Fut_gap.mq5  46 kb
 
prostotrader:

....

Añadido

¿Nadie tiene alguna idea de cómo salir de la posición, con alto volumen?

En pequeñas porciones. Establezca un límite en el precio por encima/por debajo del cual cerrar la posición por partes. Por ejemplo, usted toma una posición de compra. Se establece un límite para cerrar la posición por el precio superior a 100 RUB. Y si el precio está por encima de 100 vendes por porciones o por precio límite o de mercado.

 
prostotrader:

Se me ha ocurrido que con el parón de la negociación del SPOT, esto se podría utilizar en una estrategia bastante arriesgada (Fut Gap).

estrategia arriesgada (Fut Gap). La idea es que no compramos acciones, sino que sólo vendemos futuros

con el Gap que establecimos.

Cuando la acción se negocia, calculamos la delta media entre los futuros y la acción, y cuando

establecemos la(s) orden(es) de venta de los futuros (el delta calculado + nuestro Gap).

Y por la mañana vendemos los futuros.

(La cuestión es cómo vender, si la posición es lo suficientemente grande).


No funcionará en la demo.

Añadido



¿Y si vendemos, y el mercado sube más?

En cuanto al cierre - depende del volumen, si es grande, lo divido en lotes de 5-10 y lo pongo en el spread - funciona bien en un mercado rápido, pero el proceso no está automatizado para mí.

 

¿Alguien escribirá una función de salida para el puesto?

//+------------------------------------------------------------------+
//| Expert Exit From Position function                               |
//+------------------------------------------------------------------+
void ExitFromPosition()
{
  double pos_price = GetPositionPrice(fut_symbol);
  if(pos_price > 0)
  {
    double cur_price = SymbolInfoDouble(fut_symbol, SYMBOL_ASK);
    //TODO???
  }  
}
Archivos adjuntos:
Fut_gap.mq5  50 kb
 
Aleksey Vyazmikin:

¿Y si vendes y el mercado sigue subiendo?

Usted establece su propia "codicia" :)

input long PrGap        = 100;        //Гап вверх(пункты)
 
prostotrader:

Usted establece su propia "codicia" :)

No entiendo - abrimos un corto, pero el mercado siguió empujando hacia arriba - no pudimos cerrarlo en el primer minuto y usamos los stops - no entiendo.

prostotrader:

¿Puede alguien escribir una función para salir de una posición?

¿Y cómo se decide la salida? Puedo darte una clase sobre cómo trabajar con posiciones - abrir/cerrar/modificar...

 
Aleksey Vyazmikin:

No entiendo - abrimos el corto, pero el mercado sigue presionando al alza - no cerrar en el primer minuto, será cableado con las paradas - no entiendo.


No lo entiendo.

En el primer puesto dice:

"Seme ocurrió que cuando se detienen las operaciones SPOT, se podría utilizar esto en un

estrategiaarriesgada(Fut Gap)"

 
prostotrader:

Hay que leer con atención.

El primer puesto dice:

"Seme ocurrió que al dejar de operar en SPOT se podría utilizar esto en un

estrategiaarriesgada(Fut Gap)"

La redacción debe ser informativa, nunca entendí nada de fondo.

 
Aleksey Vyazmikin:

Tienes que escribir de forma informativa, aún no entiendo lo esencial.

Dame tu número de tarjeta, tal vez pueda transferirte dinero....

Bueno, en serio, la cuestión es esta.

Después de que se detenga la negociación de las acciones, los futuros siguen negociando - ESPECULADAMENTE,

porque el precio de los futuros depende del precio de las acciones. Al día siguiente la acción puede caer o subir (50/50), ¡PERO!

La delta entre los futuros y las acciones de ayer, es mayor que la delta de hoy, de ahí nuestros riesgos (50 - algunos %).

Siguiente... Queremos vender los futuros mucho más altos de lo que cotizaban antes del cierre de las acciones,

por lo que nuestros riesgos = (50 - algún % sobre el delta - algún % sobre el Gap que fijamos).

¿Está claro ahora?

Razón de la queja: