- ago
Is it possible to make the beginning of the backtest and the benchmark start from the same point?

0
387
Solved
7 Replies

Reply

Bookmark

Sort
- ago
#1
Yes. Set the StartIndex property accordingly in your C# code:

https://www.wealth-lab.com/Support/ApiReference/UserStrategyBase
0
Best Answer
- ago
#2
Yes, thanks, that's indeed the case in c# strategies. I forgot to mention, I meant a strategy of blocks. Is it possible to synchronize the benchmark with the equity chart in block strategies or does it need to be converted to C#?
0
- ago
#3
It has to be opened in a new C# Strategy window. There's no 'arbitrary StartIndex value' Block currently.
0
Cone8
 ( 26.90% )
- ago
#4
There's no difference. Block strategies will assign the length of the longest indicator to the StartIndex, so this is also where the benchmark backtest starts.

Note!
The benchmark backtest will always start at the StartIndex, but your Strategy might not have its first trade until much later. The beginning of the graph is the date of the StartIndex.
1
- ago
#5
QUOTE:
Block strategies will assign the length of the longest indicator to the StartIndex


Precisely, this is true when using standard indicators. I used the ScaleInd indicator. In this case StartIndex = 0
0
Cone8
 ( 26.90% )
- ago
#6
Simple. Just add another BuyAtLimit $0 rule at the bottom and add some indicator condition and set the length to whatever StartIndex you'd like. I haven't tried it, but theoretically, the rule should never trigger a trade (or a signal).

Edit -
The blocks don't have a BuyAtLimit Value, but if you put 100% below the Close, it should be the same result.

.. and I was wrong about the Signal, which occurs for infinite shares $0 - maybe I can fix that in time for Build 35.
0
- ago
#7
Well, yes, as an option, it is possible in this way
0

Reply

Bookmark

Sort