Drawing Color Line

 

I want to DRAW_COLOR_LINE if 

for(int i=0; i>100; i++) {
if(open[i]>=close[i+1]) // continue this until the condition becomes false for multiple bars
//DRAW COLOR LINE
}

Currently its being done using OBJ_TREND objects which make chart laggy and slow and load objects slow sometimes so i want to do this using buffer

any coding help will be really helpful

Example : 

Документация по MQL5: Пользовательские индикаторы / Стили индикаторов в примерах / DRAW_COLOR_LINE
Документация по MQL5: Пользовательские индикаторы / Стили индикаторов в примерах / DRAW_COLOR_LINE
  • www.mql5.com
DRAW_COLOR_LINE - Стили индикаторов в примерах - Пользовательские индикаторы - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 

You have few solutions:

1. limit the number of bars in history so it loads faster

2. make sure not to draw the same objects several times

3. update indicator only when a new bar closes

4. use buffers

 
Yashar Seyyedin #:

You have few solutions:

1. limit the number of bars in history so it loads faster

2. make sure not to draw the same objects several times

3. update indicator only when a new bar closes

4. use buffers

I choose 4. use buffers