When running a backtest, is it possible to capture indicator values at trade entry automatically into a table of data?
My objective is to examine my indicator(s) values at each trade entry with the detailed report closed positions list, my aim is to compare those indicator values at trade entry when the system makes losses and those indicator values at trade entry when the system makes gains.
Please use the automated trading forum for that type of question, thanks.
Yes, that would be possible. The best way would be to use variables in array (not possible in versions prior to v11). Example with the RSI:
1
2
3
4
5
6
7
irsi=rsi[14]
buycondition=irsicrosses over50
ifbuyconditionthen
buyatmarket
$var[lastset($var)+1]=irsi
endif
After that make a loop through all $var to analyze the performance of each order. That is a rough code snippet that would need further work but that’s the main idea..
Please use the automated trading forum for that type of question, thanks.
Yes, that would be possible. The best way would be to use variables in array (not possible in versions prior to v11). Example with the RSI:
1
2
3
4
5
6
7
irsi =rsi[14]
buycondition = irsi crosses over50
if buycondition then
buyatmarket
$var[lastset($var)+1]= irsi
endif
After that make a loop through all $var to analyze the performance of each order. That is a rough code snippet that would need further work but that’s the main idea..
Hi, thanks for that. I have a question, how would you calculate the average of the numbers contained in the table $var ? Thank you
Please use the automated trading forum for that type of question, thanks.
Yes, that would be possible. The best way would be to use variables in array (not possible in versions prior to v11). Example with the RSI:
1
2
3
4
5
6
7
irsi =rsi[14]
buycondition = irsi crosses over50
if buycondition then
buyatmarket
$var[lastset($var)+1]= irsi
endif
After that make a loop through all $var to analyze the performance of each order. That is a rough code snippet that would need further work but that’s the main idea..
Hi, thanks for that. I have a question, how would you calculate the average of the numbers contained in the table $var ? Thank you
Edit : I struggle with it only because PRT v11 is not available with IG yet 🙂