Topics
29 Nov 2017, 05:02
1825
2
23 Jun 2016, 10:46
2301
3
21 Jun 2016, 08:18
7386
11
24 Feb 2016, 05:35
2353
2
Replies
xjacks
22 Jun 2016, 03:10
RE:
Hi tmc, thank you very much, it's a perfect solution !
tmc. said:
Hi, this method returns you how many bars back was the highest or lowest bar within a period.
private int HighestBar(DataSeries series, int period) { for (int i = 0; i <= period; i++) { if (series[series.Count - 1 - i] == series.Maximum(period)) { return i; } } return -1; } private int LowestBar(DataSeries series, int period) { for (int i = 0; i <= period; i++) { if (series[series.Count - 1 - i] == series.Minimum(period)) { return i; } } return -1; }
@xjacks
xjacks
29 Nov 2017, 05:04
I'm so sorry that I found that my account currency is JPY, so the profit displayed on the backtest result is converted to JPY. This can explian my question.
Please close my thread, thank you.
@xjacks