Hello forum, I want to construct a pivot point indicator that applies to a specified time period and not an entire day.
Was looking at previous posts including a similar question I asked previously and now just want to check the base premise of how to define the market hour time range.
You can assume that there were ticks during every 380 minutes in your time period . . . but that is probably a poor assumption to make, why not simply get the bar number for your start and end times . . . and get the Highest and Lowest between those bar numbers ?
string StartTime = "8:50", EndTime = "15:10"; int StartBar, EndBar; double Val; StartBar = iBarShift(NULL, 0, StrToTime(StartTime) ); EndBar = iBarShift(NULL, 0, StrToTime(EndTime) ); Val = High[iHighest(NULL, 0, MODE_HIGH, StartBar - EndBar + 1, EndBar) ];
You can assume that there were ticks during every 380 minutes in your time period . . . but that is probably a poor assumption to make, why not simply get the bar number for your start and end times . . . and get the Highest and Lowest between those bar numbers ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello forum, I want to construct a pivot point indicator that applies to a specified time period and not an entire day.
Was looking at previous posts including a similar question I asked previously and now just want to check the base premise of how to define the market hour time range.
If market is open between 8:50 in the morning and 15:10 in the afternoon ( a period of 380 minutes) for example Monday to Friday
(trying to use atypical hours here for purpose of example)
then if I wanted to make my pivot calculatiions based on this time range.
would it be reasonable to do the calculations relative to the close time each day (in this example 15:10)
and consequently, to get the high of the specified market open hours range, is it correct to use this as part of my code.
Val=High(iHighest(NULL, 0, MODE_HIGH, 380, iBarShift(NULL, 0, 15:10) ) )
I've never used this function before and confused about how to reference the closing time each day, and secondly only on specific days.
I think I can complete the rest of the indicator, define the pivot calculations etc, if I can just get the time referencing correct.
any help appreciated
Dave
: