@delo5 Sorry. I forgot to include the link:
https://fxdreema.com/shared/LHZfs3gvb
This is a very rough approach to what you need. However, if you need to take into account all previous closed trades within the same day, then you will need an additional structure with variables counting for them.