
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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 ?
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
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