do you have some code written yourself already?
With time based inputs optimization can be more "problematic" as when you try to optimize from 930 to 1030 in steps of one, the optimizer would also test 961, 962 etc.. One way around that is to use minutes since midnight as an input for example. This might take some time to getting used to it, but it will avoid the issue with non-existing times.
This should get you started:
The following user says Thank You to ABCTG for this post:
Thank you sir, yes I just finished it up and that was exactly the problem I was running into. Not sure how good the code is either. Was talking to some folks and they provided some code to use the computer time but it sill shows times like 960 990 etc when running the optimization. My code is below but let me give yours a shot. I like the idea of minutes much better! I put a trend filter on this one when I was testing. Only buy when price is above moving average.
// define ALL your variables for storage. Var: Min(0),TheOpen_Min(0), MA200 ( 0 );
Min = timetominutes(time);
TheOpen_Min = timetominutes(The_Open);
MA200 = Average(Close, RegimeLookback);
// The_Open to The_Close - 1 barinterval to allow a close before the market close's.
If min >= TheOpen_Min and Min <= timetominutes(calctime(THE_CLOSE,-barInterval)) and ( Close > MA200 ) Then
Buy next bar market;
you are welcome. My code is just something I put together here in the thread. One issue that could occur is that there is no bar with the time you are currently testing. That would obviously much more dangerous for the exit than for an entry. So it might make sense expand the code with two flags a bit to allow for those situations.
The following 2 users say Thank You to ABCTG for this post: