# Optimizing Time Window Results

Questions about MultiCharts and user contributed studies.
Posts: 15
Joined: 14 Feb 2011
Has thanked: 7 times
Been thanked: 3 times

### Optimizing Time Window Results

Hi,

Most of my trading systems use time and so I optimizing start and end times, say, for a time window to place an order.

Typically, I will set up optimization start value at 0830 and end value at 1500, which a step of 5, 10 or 15.

Since the time when optimizing is base 10, the best optimized result may be 0970.

How is that 0970 time represented on the chart? And, is there any issue with using that time in a signal input? Does it need a conversion of some kind?

Not used to seeing times represented this way and would like to know how they are managed in MC.

Thanks!

JoshM
Posts: 2099
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1527 times
Been thanked: 1494 times
Contact:

### Re: Optimizing Time Window Results

FATSTrader wrote:How is that 0970 time represented on the chart? And, is there any issue with using that time in a signal input? Does it need a conversion of some kind?

Perhaps you could use something like this:

Code: Select all

`vars: DateTimeDifference(0);if CurrentBar < 300 then begin      DateTimeDifference = ElTimeToDateTime_s(Time_s) - ElTimeToDateTime_s(Time_s[1]);   Print("Time: ", NumToStr(time_s, 0), " in DateTime: ", NumToStr(eltimetodatetime_s(time_s), 5),       " DateTime Difference: ", NumToStr(DateTimeDifference, 5));end;`

which gives as output..

Time: 82000 in DateTime: 0.34722 DateTime Difference: 0.00694
Time: 83000 in DateTime: 0.35417 DateTime Difference: 0.00694
Time: 84000 in DateTime: 0.36111 DateTime Difference: 0.00694
Time: 85000 in DateTime: 0.36806 DateTime Difference: 0.00694
Time: 90000 in DateTime: 0.37500 DateTime Difference: 0.00694
Time: 91000 in DateTime: 0.38194 DateTime Difference: 0.00694
Time: 92000 in DateTime: 0.38889 DateTime Difference: 0.00694
Time: 93000 in DateTime: 0.39583 DateTime Difference: 0.00694
Time: 94000 in DateTime: 0.40278 DateTime Difference: 0.00694
Time: 95000 in DateTime: 0.40972 DateTime Difference: 0.00694
Time: 100000 in DateTime: 0.41667 DateTime Difference: 0.00694
Time: 101000 in DateTime: 0.42361 DateTime Difference: 0.00694
Time: 102000 in DateTime: 0.43056 DateTime Difference: 0.00694
Time: 103000 in DateTime: 0.43750 DateTime Difference: 0.00694
Time: 104000 in DateTime: 0.44444 DateTime Difference: 0.00694
Time: 105000 in DateTime: 0.45139 DateTime Difference: 0.00694
Time: 110000 in DateTime: 0.45833 DateTime Difference: 0.00694

In other words, if you let the DateTime increment with 0.00694 this will correspond with an increment of 10 minutes in EasyLanguage time, without weird results when a new hour starts.

Regards,
Josh
These users thanked the author JoshM for the post:
Stan Bokov

Posts: 353
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 215 times

### Re: Optimizing Time Window Results

You may also want to see this link which discusses an "AddMinutes" function to allow you to optimize over different intraday time periods: