Calculate Position based on high - low of specific hours
Created at 25 Apr 2021, 22:33
CT
Calculate Position based on high - low of specific hours
25 Apr 2021, 22:33
How do I retrieve the high and low of a current day, and 2 specific time points (static, form the current day) from a chart into the Bot, in order for it to use this new variable in a proceding caclculation?
amusleh
02 May 2021, 10:23
Hi,
There are different ways to do this, one if load daily bars data and find the index of current day by using GetIndexByTime method of daily Bars.OpenTimes series and once you got the index you can query its high or low price levels via daily bars collection.
You can also do this without using the daily bars, you can set a specific time as day start time and then use a loop over your current chart bars to find the maximum high price and minimum low price, here is a complete indicator example:
Increase the number of "Days #" parameter to show the high/low lines for more days, these two lines show the developing high/low levels of each day until the day ends.
If you check the API references you will be able to do this easily based on your needs.
If you can't do this by your self then post a job request or contact one of our consultants.
@amusleh