How to Check on a certain part of the graph . ( Backtesting ? using a certain date and time )

 

hi !! thanks for the reply. lets take an example cos that how i understand better. suppose i have a smal loop to find out all the HIGH values of the candle sticks for a portion of the graph say starting from 3rd nov 12.00 Pm to 4 PM the same day, how wud i incorporate that in offline testing ? code :

for (j=0; j <=50; j++) {

high[i]=crest[i]

... some calculations based on the crest values }

now how do i ensure that this for loop is iterated for a portion of the graph that corresponds to the date and time values as i have mentioned above ( 3rd NOv, from 12 PM to 3 PM - for as many values as the for loop wants ( meaning i can change the value j from 50 to 100 or 150 as long as they fall within the given time period.).

Do i use a while loop with the time and date values? can u please show me how that code wud be written ?

138fx1.net 2010.10.31 12:47

aps: you are talking about backtesting? If so you must activate [x] Use Date Feature and define date. Its not possible to limit tests to certain bars from GUI BUT from code. Its simple:

you must determine TimeRanges and simply do like:

// to limit test to January

if (Time[0]>=D'01.01.2010 00:00:00' && Time[0]<D'01.02.2010 00:00:00') { ......... your strategy }

// to limit test since February

if (Time[0]>=D'01.02.2010 00:00:00') { ......... your strategy }

You can also use IsTesting() function to limit your restrictions to backtesting


12
aps 2010.11.04 15:18

fx1.net:

aps: you are talking about backtesting? If so you must activate [x] Use Date Feature and define date. Its not possible to limit tests to certain bars from GUI BUT from code. Its simple:

you must determine TimeRanges and simply do like:

// to limit test to January

if (Time[0]>=D'01.01.2010 00:00:00' && Time[0]<D'01.02.2010 00:00:00') { ......... your stratemgy }

// to limit test since February

if (Time[0]>=D'01.02.2010 00:00:00') { ......... your strategy }

You can also use IsTesting() function to limit your restrictions to backtesting