void OnStart()
{
//---
string up_arrow="up_arrow";
datetime time=TimeCurrent();
double lastClose[1];
int close=CopyClose(Symbol(),Period(),0,1,lastClose); // obtenemos el precio Close
//--- si hemos recibido el precio
if(close>0)
{
ObjectCreate(0,up_arrow,OBJ_ARROW,0,0,0,0,0); // creamos la flecha
ObjectSetInteger(0,up_arrow,OBJPROP_ARROWCODE,241); // definimos el código de la flecha
ObjectSetInteger(0,up_arrow,OBJPROP_TIME,time); // definimos la hora
ObjectSetDouble(0,up_arrow,OBJPROP_PRICE,lastClose[0]);// definimos el precio
ChartRedraw(0); // redibujamos la ventana
}
else
Print("Fallo al recibir el último precio Close!");
}
|