# Defining a time frame

Forums ProRealTime English forum ProBuilder support Defining a time frame

This topic contains 5 replies, has 2 voices, and was last updated by  fxbravo 5 months, 1 week ago.

View all attachments
Viewing 6 posts - 1 through 6 (of 6 total)
• #86440

Hello gentlemen,

I want to code this need, but I don’t know how to do it!

My need: I take a simple RSI(14) but I want to check X time by day if the condition is OK or NotOK

Here a drawto show you:

9h00: the indicator check if the conditon is OK until 12h00 (it’s ok for this)

14h00: the indicator check again if the condition is ok until 18h00/ It could be OK or NotOK, whatever it happen (OK or NotOK) between 9h/13h59 (like it’s the begining of the day, minus the timeframe 9h00/13h59)

So, my problem is to “reset” à 14h00 the indicator

Have a perfect day

#86444

It seems easy to reset a variable to 0 or whatever other value, so I don’t think that’s the main reason of your question? Do you still use the value “ok / not ok” of the morning period but in the afternoon? BTW, would be easier and faster to understand and reply with the code.

#86446

Hello Nicolas,

You’re right, it’s better with code 😉

here an example of code I posted few days ago (the logic is the same):

So, this morning, atrmax was 29 in UT1. So no pb for me, the market’spsychology is OK with that ATR. But, during lunch time, it’s not the same thing. And I wanted to “resest” the indicator with atrmax begining at 12h00, not 00h00.

Hope that I explain this clearly 😉

Thank you for your help Nicolas.

Have a perfect day.

#86449

If I could code this I’ll do:

So, if the value atrmax is X between 00h00 and 12h00, the code do the formula with X value.

And if the  value atrmax is Y between 12h00 and 23h59, the code do the formula with Y value.

#86454

This is what you need:

The period is a subtraction between the current barindex and the one saved when you want the period of calculation to start, at the beginning of the day or at 120000.

#86461