Working on a certain protion of the graph

 
hi everyone. is it possible for me to test my code on a given set of bars that i can define? like a certain portion of the graph that i want to test my data on while testing it off line. if so how can it be done. Thanks
 

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

 

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 ?

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

 
hi !
pls can you illustrate this wid an example i have requested?
Reason: