![MQL5 - Lenguaje de estrategias comerciales para el terminal de cliente MetaTrader 5](https://c.mql5.com/i/registerlandings/logo-2.png)
Está perdiendo oportunidades comerciales:
- Aplicaciones de trading gratuitas
- 8 000+ señales para copiar
- Noticias económicas para analizar los mercados financieros
Registro
Entrada
Usted acepta la política del sitio web y las condiciones de uso
Si no tiene cuenta de usuario, regístrese
Hola tengo un indicador que dibuja una linea en la posicion de velas que el usuario elija, como puedo hacer para que se pueda ingresar mas de una linea
//+------------------------------------------------------------------+
//| MFCS GridLines.mq5 |
//| Copyright 2015, Mansukh Patidar, All rights reserved. |
//| http://www.mansukhpatidar.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, Mansukh Patidar, All rights reserved."
#property link "http://www.mansukhpatidar.com"
#property version "1.00"
#property indicator_chart_window
#property indicator_plots 0
//--- input parameters
input int lines=100;
input int interval=200;
input ENUM_LINE_STYLE line_style=STYLE_DOT;
input int line_width = 1;
input color line_color = C'128, 50, 50';
#property copyright "Copyright 2020, MetaQuotes Software Corp." //< 1>
#property link "https://www.mql5.com" //< 2>
#property version "1.000" //< 3>
#property description "AIS AIRAT SAFIN" //< 4>
//< 5>
string NAME = "AIS INDICATOR 2 CANDLES CONNECTOR" ; //< 6>
long CHART = NULL ; //< 7>
int WINDOW = NULL ; //< 8>
//< 9>
#property indicator_chart_window //<10>
#property indicator_buffers 1 //<11>
#property indicator_plots 1 //<12>
//<13>
#define E_TF ENUM_TIMEFRAMES //<14>
//<15>
string SYMBOL = _Symbol ; //<16>
E_TF PERIOD = _Period ; //<17>
//============================================================================//
// AIS AIRAT SAFIN 2020-05-06 19:57 //
/******************************************************************************/
// AIS INDICATOR 2 CANDLES CONNECTOR //
//============================================================================//
// DATA 2 //< >
//------------------------------------------------------------------------//<-->
sinput string S1="=================="; /* ============================ */ //< 1>
sinput int CANDLE_FIRST = 5 ; /* FIRST CANDLE */ //< 2>
sinput int CANDLE_LAST = 29 ; /* LAST CANDLE */ //< 3>
sinput string S2="=================="; /* ============================ */ //< 4>
sinput int LINE_WIDTH = 3 ; /* LINE WIDTH */ //< 5>
sinput color LINE_COLOR = White; /* LINE COLOR */ //< 6>
sinput string S3="=================="; /* ============================ */ //< 7>
int OnInit () { //< 1>
//< 2>
ObjectCreate ( CHART , NAME , OBJ_TREND , WINDOW , 0 , 0 ) ; //< 3>
ObjectSetInteger ( CHART , NAME , OBJPROP_COLOR , LINE_COLOR ) ; //< 4>
ObjectSetInteger ( CHART , NAME , OBJPROP_WIDTH , LINE_WIDTH ) ; //< 5>
ObjectSetInteger ( CHART , NAME , OBJPROP_STYLE , STYLE_SOLID ) ; //< 6>
ObjectSetInteger ( CHART , NAME , OBJPROP_BACK , true ) ; //< 7>
//< 8>
return INIT_SUCCEEDED ; } //<17>
void OnDeinit ( const int REASON ) { //< 1>
//< 2>
ObjectDelete ( CHART , NAME ) ; //< 3>
ChartRedraw () ; //< 4>
} //<17>
int OnCalculate (const int R,const int C,const int B,const double&P[]){//< 1>
//< 2>
if ( ! NEW_CANDLE () ) return NULL ; //< 3>
//< 4>
datetime TIME_FIRST = iTime ( SYMBOL , PERIOD , CANDLE_FIRST ) ; //< 5>
datetime TIME_LAST = iTime ( SYMBOL , PERIOD , CANDLE_LAST ) ; //< 6>
//< 7>
double PRICE = fmax ( iHigh ( SYMBOL , PERIOD , CANDLE_FIRST ) , //< 8>
iHigh ( SYMBOL , PERIOD , CANDLE_LAST ) ) ; //< 9>
//<10>
ObjectSetInteger ( CHART , NAME , OBJPROP_TIME , 0 , TIME_FIRST ) ; //<11>
ObjectSetInteger ( CHART , NAME , OBJPROP_TIME , 1 , TIME_LAST ) ; //<12>
ObjectSetDouble ( CHART , NAME , OBJPROP_PRICE , 0 , PRICE ) ; //<13>
ObjectSetDouble ( CHART , NAME , OBJPROP_PRICE , 1 , PRICE ) ; //<14>
ChartRedraw () ; //<15>
//<16>
return R ; } //<17>
int NEW_CANDLE () { //< 1>
//< 2>
static datetime TIME_LAST = NULL ; //< 3>
datetime TIME_THIS = iTime ( SYMBOL , PERIOD , 0 ) ; //< 4>
//< 5>
if ( TIME_LAST < TIME_THIS ) //< 6>
{ //< 7>
TIME_LAST = TIME_THIS ; //< 8>
//< 9>
return true ; //<10>
} //<11>
else return NULL ; //<12>
} //<17>