How to get the exact time of a High

Created at 19 Jul 2022, 22:27
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!
WO

work_fin

Joined 07.07.2022

How to get the exact time of a High
19 Jul 2022, 22:27


Hi All, 

Hopefully an easy one. 

I want to find the exact time a high price occurred. 

I have the following code that plots the last 4 Monthly High points:

var monthhigh = MarketData.GetBars(TimeFrame.Monthly, Symbol.Name);

for (int i=0; i<5; ++i)
{

    Chart.DrawTrendLine("MonthHigh" + i, monthhigh.Last(i).OpenTime, monthhigh.Last(i).High, Server.Time.AddDays(1), monthhigh.Last(i).High, Color.Green, 2, LineStyle.DotsVeryRare).Comment = "H";

}

The problem is i can only seem to plot the line from the Open of the Month, as shown:

monthhigh.Last(i).OpenTime

Is it possible to get the actual DateTime of the high? 

Thanks in advance


@work_fin
Replies

PanagiotisCharalampous
20 Jul 2022, 09:32

Hi colymaxa,

You will need to go through tick data to achieve this. You need to find the exact tick with the specific price. You will need to use the GetTicks() method.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous