- ago
I defeated the problem of post-filtering orders (thanks for your help). The next question I faced is:

When I set Data Range in Strategy Settings (Strategy Monitor) all the positions that were opened while this period and were not closed within it, will generate closing signals after starting real trading, right? But there will be no real positions for those, so I need to ignore those closing signal manually?

The final goal is to have a flow like this: you add a strategy, set autorun (for Daily) and check it once a week or something)).
0
247
Solved
10 Replies

Reply

Bookmark

Sort
- ago
#1
It looks like I could use Date Range option of Data Range, like I set the strategy adding date as From, and some point in the far future as To. If it is what I am looking for, why it's not a default option?)
0
- ago
#2
Or it can be like this:
CODE:
public override void Initialize(BarHistory bars) {          //started trading it for real on Nov 08          DateTime dtRealStart = new DateTime(2021, 11, 08);          int idx = bars.DateTimes.IndexOf(dtRealStart.Date);          if(idx > 0)             StartIndex = idx; }
1
Best Answer
- ago
#3
Thanks, Eugene.

I'll try this.

Still being able to do this with UI looks like a better way - because you do not modify a strategy and you can use it for backtesting at any time.

But I remembered that I couldn't set From later than now minus 15 days. Why do you have this restriction? Could you delete it? Actually all of the options of Data Range do not allow set "From" close to current date.
0
- ago
#4
Although I could use if (ExecuteMode ...) {...}, but it will inflate every strategy's code, being able to do it with UI looks like a better choice.
0
Cone8
 ( 24.57% )
- ago
#5
QUOTE:
I set the strategy adding date as From, and some point in the far future as To.
What's the problem doing it this way?

The only thing you'd have to be careful about is the amount of "seed data". If you need 20 bars for a SMA, your Strategy should already have StartIndex = 20; You'd need to calculate the "From" date 20 market days ago from "today".
0
- ago
#6
QUOTE:
The only thing you'd have to be careful about is the amount of "seed data". If you need 20 bars for a SMA, your Strategy should already have StartIndex = 20; You'd need to calculate the "From" date 20 market days ago from "today".


According to Glitch's answer here it seems I can set From as only 5 days ago and 20-days SMA will still look 20 days back (and find data):

https://www.wealth-lab.com/Discussion/Will-the-strategy-get-data-for-indicators-if-an-indicator-window-is-more-than-data-range-in-strategy-monitor-7106

0
Glitch8
 ( 10.41% )
- ago
#7
Nope, sorry for any misunderstanding but the indicator can only be composed of the data range you selected, WL7 does not go back any further.
0
- ago
#8
QUOTE:
Nope, sorry for any misunderstanding but the indicator can only be composed of the data range you selected, WL7 does not go back any further.

I see. Did you think of splitting Data Range parameter in Strategy Monitor -> Strategy Settings into two? Like GetDataFrom and ExecuteCandlesFrom. Because now (if you deal with UI controls only) what you get is: your indicators are not fully calculated or you get exit signals for positions you do not have.

I'm still getting into it, so I may be wrong).

Eugene's "code" solution looks like a solution for this so I'll use it for now. But as I've already mentioned, being able to do this with UI controls, rather then editing every strategy is a better option as for me.
0
Glitch8
 ( 10.41% )
- ago
#9
I'm not sure complicating things more by adding more UI controls would bring enough benefit. It's working well now with StartIndex an I don't see a pressing need for a change like that.
1
- ago
#10
You are right in thinking it's not a pressing need) - as there is code solution.

Ok, I'll use StartIndex then. I have no more question on this topic).
0

Reply

Bookmark

Sort