Thank you JoshM.
OK, it's clear. I would like to avoid the time based commands because with my better settings in Quote Manager (sessions start from 8:59am to 8:34pm) and with hourly resolution (60minutes or 1hour) I notice that all events occur at 9:59 (first bar) or 10:59 (second bar) or 11:59 (third bar) and so on.. produce badly entries on the next bar on the chart. For example in this picture I attach below the entry "Tmp_V2_1" should be on the first bar (bar 9:59) and not on the second one:
Indeed the part of code for this entry is here:
Code: Select all
if time > 900 and time <= 959 then Begin //if I am in the first hourly bar (9:59)
if h[4]<h[5] AND h[3]<h[4] AND c[1]<DEMA and marketposition=0 and daily_entries=0 then Begin
if ((o[3]-c[3])/o[3])<0.002 then Begin
sellshort ("TmpV2_1") 1 contracts next bar at valenter limit;
condEntry=1;
End;
End;
End;
The same happens for the other bars if all conditions are verified at the 59th minute. Analysing with print debugging the strange behaviour I realized that if I remove "=" from the code changing into:
if time > 900 and time <959 then Begin..., the change seems to correct the problem but I will lose all 59' which means a sensitive decreasing of number of entries in my study. It's really odd
because hh:59 should be in the previous bar as I already mentioned that the my session starts at 8:59 and resolution is @60 minutes. That's why I was searching a workaround to bypass time.
Thank you