How to get Open Day Price, Hour, minutes and seconds time

Created at 17 Jul 2013, 14:30
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
breakermind's avatar

breakermind

Joined 17.07.2013

How to get Open Day Price, Hour, minutes and seconds time
17 Jul 2013, 14:30


Hello,

I need the equivalent function of MT4
robot operates a period M1 !!!

//Openday price
double Dayline = iOpen (NULL, PERIOD_D1, 0);

//Closeday price
double DaylineClose = iClose (NULL, PERIOD_D1, 0);

//Create line
ObjectCreate ("Dayline" OBJ_HLINE, 0, Time [0], Dayline);

// high bars
iHigh (NULL, PERIOD_D1, 0);

Hours ()

Minutes ()

Seconds ()

Surely the answer is trivial, but I can not be traced in the documentation.
Thank you in advance and
Regards


@breakermind
Replies

breakermind
17 Jul 2013, 20:35

RE:
breakermind said:

Hello,

I need the equivalent function of MT4
robot operates a period M1 !!!

//Openday price
double Dayline = iOpen (NULL, PERIOD_D1, 0);

//Closeday price
double DaylineClose = iClose (NULL, PERIOD_D1, 0);

//Create line
ObjectCreate ("Dayline" OBJ_HLINE, 0, Time [0], Dayline);

// high bars
iHigh (NULL, PERIOD_D1, 0);

Hours ()

Minutes ()

Seconds ()

Surely the answer is trivial, but I can not be traced in the documentation.
Thank you in advance and
Regards

It is no longer valid.

     / / When M1 - first day bar open price
     int minute = Server.Time.Minute;
     int hour = Server.Time.Hour;
     int backBars = hour * 60 + minute;
     var lastIndex = MarketSeries.Open.Count;
     double OpenPriceDay = MarketSeries.Open [lastIndex-backBars-1];

Regards and bye.


@breakermind

goodtrades
09 Sep 2014, 06:46

Hi Breakermind - can i get your email?


@goodtrades

breakermind
10 Sep 2014, 18:35

hello@

Hi,

in profil ... signature.

Bye

 


@breakermind