OBJ_ARROW_SELL no se grafica

Foro para cuestiones generales sobre la plataforma MetaTrader 4.

OBJ_ARROW_SELL no se grafica

Notapor Miguelsnts » 07 Ene 2015, 17:42

Estoy intentando que se grafique una flecha roja hacia abajo cada vez que se lance una orden de venta al mercado, para ello estoy usando las siguientes lineas para acoplarlas a mi código:

Código: Seleccionar todo
ObjectDelete(0,"A");
ObjectCreate(0,"A",OBJ_ARROW_SELL,0,0,0);
ObjectSet("A",OBJ_ARROW_SELL,Bid);


...sin embargo, no se grafica ni una sola flecha, ¿qué me falta por añadir?

Ojala alguien sea capaz de ayudarme con esto. Muchas gracias de antemano.

Un saludo.
Adjuntos
Captura.JPG
Captura.JPG (10.67 KiB) Visto 1177 veces
Miguelsnts
 
Mensajes: 40
Registrado: 03 Nov 2012, 09:36
Karma: 0

Re: OBJ_ARROW_SELL no se grafica

Notapor FXWizard » 08 Ene 2015, 11:21

Hola Miguelsnts, creo que te falta definir el tiempo y el nivel de precio en el que se dibuja la flecha, observa que en ObjectCreate has puesto todos los parámetros a 0.

Según indica la documentación de MQL4:

http://docs.mql4.com/objects/objectcreate

ObjectCreate
The function creates an object with the specified name, type, and the initial coordinates in the specified chart subwindow of the specified chart. There are two variants of the function:

Código: Seleccionar todo
bool  ObjectCreate(
   long          chart_id,      // chart ID
   string        object_name,   // object name
   ENUM_OBJECT   object_type,   // object type
   int           sub_window,    // window index
   datetime      time1,         // time of the first anchor point
   double        price1,        // price of the first anchor point
   ...
   datetime      timeN=0,       // time of the N-th anchor point
   double        priceN=0       // price of the N-th anchor point
   );


The function creates an object with the specified name, type, and the initial coordinates in the specified chart subwindow:

Código: Seleccionar todo
bool  ObjectCreate(
   string        object_name,   // object name
   ENUM_OBJECT   object_type,   // object type
   int           sub_window,    // window index
   datetime      time1,         // time of the first anchor point
   double        price1,        // price of the first anchor point
   datetime      time2=0,       // time of the second anchor point
   double        price2=0,      // price of the second anchor point
   datetime      time3=0,       // time of the third anchor point
   double        price3=0       // price of the third anchor point
   );


Parameters

chart_id [in] Chart identifier.
object_name [in] Name of the object. The name must be unique within a chart, including its subwindows.
object_type [in] Object type. The value can be one of the values of the ENUM_OBJECT enumeration.
sub_window [in] Number of the chart subwindow. 0 means the main chart window. The specified subwindow must exist (window index must be greater or equal to 0 and less than WindowsTotal()), otherwise the function returns false.
time1 [in] The time coordinate of the first anchor point.
price1 [in] The price coordinate of the first anchor point.
time2=0 [in] The time coordinate of the second anchor point.
price2=0 [in] The price coordinate of the second anchor point.
time3=0 [in] The time coordinate of the third anchor point.
price3=0 [in] The price coordinate of the third anchor point.
timeN=0 [in] The time coordinate of the N-th anchor point.
priceN=0 [in] The price coordinate of the N-th anchor point.


Este ejemplo de código que presenta una flecha arriba o abajo en cada tick debería servirte como referencia:

Código: Seleccionar todo
int i;
i=Bars;

name = "Dn"-i;
ObjectCreate(name, OBJ_ARROW, 0, Time[a], High[a]+20*Point); //draw an up arrow
ObjectSet(name, OBJPROP_STYLE, STYLE_SOLID);
ObjectSet(name, OBJPROP_ARROWCODE, SYMBOL_ARROWUP);
ObjectSet(name, OBJPROP_COLOR,Blue);

name2 = "Dn"+i;
ObjectCreate(name2,OBJ_ARROW, 0, Time[a], Low[a]-20*Point); //draw a dn arrow
ObjectSet(name2, OBJPROP_STYLE, STYLE_SOLID);
ObjectSet(name2, OBJPROP_ARROWCODE, SYMBOL_ARROWDOWN);
ObjectSet(name2, OBJPROP_COLOR,Red);


Espero haberte ayudado.

Saludos,
FXWizard
Avatar de Usuario
FXWizard
 
Mensajes: 8493
Registrado: 12 Feb 2008, 15:17
Karma: 35


Volver a MetaTrader 4

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados