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
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.
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.
Warning: Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced clients who have sufficient financial means to bear such risk. The articles, codes and content on this website only contain general information. They are not personal or investment advice nor a solicitation to buy or sell any financial instrument. Each investor must make their own judgement about the appropriateness of trading a financial instrument to their own financial, fiscal and legal situation.