Do
Until
aktZeile = ersteZeile
Kaufname =
"EMA5>EMA10>EMA20"
Do
Until
(Cells(aktZeile, EMA5) > Cells(aktZeile, EMA10)
And
Cells(aktZeile, EMA10) > Cells(aktZeile, EMA20))
If
aktZeile = ersteZeile
Then
Exit
Do
End
If
aktZeile = aktZeile - 1
Loop
Worksheets(
"Backtesting"
).Cells(n, 2).Value = Cells(1, 1)
Worksheets(
"Backtesting"
).Cells(n, 3).Value = Cells(aktZeile, 1)
Worksheets(
"Backtesting"
).Cells(n, 4).Value = Cells(aktZeile, 5)
Kauf = aktZeile
Verkaufname =
"EMA5<EMA10 EMA10<EMA20"
Do
Until
(Cells(aktZeile, EMA5) < Cells(aktZeile, EMA10)
Or
Cells(aktZeile, EMA10) < Cells(aktZeile, EMA20))
If
aktZeile = ersteZeile
Then
Worksheets(
"Backtesting"
).Cells(n, 5).Value = Cells(aktZeile, 1)
Worksheets(
"Backtesting"
).Cells(n, 6).Value = Cells(aktZeile, 5)
Exit
Do
End
If
aktZeile = aktZeile - 1
Loop
Worksheets(
"Backtesting"
).Cells(n, 1).Value = Kaufname &
"_"
& Verkaufname
Worksheets(
"Backtesting"
).Cells(n, 5).Value = Cells(aktZeile, 1)
Worksheets(
"Backtesting"
).Cells(n, 6).Value = Cells(aktZeile, 5)
Verkauf = aktZeile
Worksheets(
"Backtesting"
).Cells(n, 7).Value = Worksheets(
"Backtesting"
).Cells(n, 6) / Worksheets(
"Backtesting"
).Cells(n, 4) - 1
Worksheets(
"Backtesting"
).Cells(n, 8).Value = Worksheets(
"Backtesting"
).Cells(n, 5) - Worksheets(
"Backtesting"
).Cells(n, 3)
Worksheets(
"Backtesting"
).Cells(n, 9).Value = Application.WorksheetFunction.Max(Range(Cells(Kauf, 5), Cells(Verkauf, 5))) / Worksheets(
"Backtesting"
).Cells(n, 4) - 1
Worksheets(
"Backtesting"
).Cells(n, 10).Value = Application.WorksheetFunction.Min(Range(Cells(Kauf, 5), Cells(Verkauf, 5))) / Worksheets(
"Backtesting"
).Cells(n, 4) - 1
n = n + 1
Loop