Download MetaTrader 5

ObjectCreate

To add comments, please log in or register
Dua Yong Rew
5538
Dua Yong Rew  

Hi,

I have the codes to draw a horizontal trend line


datetime dt[];

ArraySetAsSeries(dt, true); 

if(CopyTime(Symbol(), PERIOD_D1, 0, 2, dt) <= 0) return(0); 

ObjectCreate(0, objname, OBJ_TREND, 0, dt[0], price, dt[1], price);

 

It draws a horizontal line from today's open hour to yesterday's open hour

but I want to draw from today's open to now (all the way to the right of the chart) 


Any idea? 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Types - Documentation on MQL5
Dua Yong Rew
5538
Dua Yong Rew  

I somehow got it.

I added 24 * 60 * 60 to today's time

onewithzachy
2269
onewithzachy  

Hi doshur,

I thought what you need is ObjectSetInteger() with OBJPROP_RAY_RIGHT or some PeriodSecond() to the right - click that.

 

-->> 911 <<--

 

Dua Yong Rew
5538
Dua Yong Rew  
onewithzachy:

Hi doshur,

I thought what you need is ObjectSetInteger() with OBJPROP_RAY_RIGHT or some PeriodSecond() to the right - click that.

 

-->> 911 <<--

 

PeriodSecond() is useful

Thanks 

To add comments, please log in or register