u33m2ha8
 ( 0.00% )
- ago
Simple example:

10-year retrospective

I buy on the 12th day of the year and hold for 32 days. If I set the command to "equal to," the system does NOT open a trade if the 12th day of the year is a Saturday, Sunday, or holiday. If I set the command to "greater than or equal to," it not only makes the desired 10 trades (10-year retrospective), but many more trades on random days.

I can, of course, add the "MnthOfYr" indicator, which makes the calculation work, but then, during optimization, I get completely crazy data, like day 40 of the year in month 6, which is obviously nonsense.

Does anyone have any idea what I'm doing wrong or how to solve this?

The goal is to specify the day of the year on which a trade should begin. If this day falls on a Saturday, Sunday, or holiday, the next trading day should be used.

Thanks in advance.
0
83
Solved
9 Replies

Reply

Bookmark

Sort
Glitch8
 ( 10.87% )
- ago
#1
When you set up the variable for optimization you need to establish a logical minimum, maximum and step values to avoid the nonsense you’re seeing.
0
Glitch8
 ( 10.87% )
- ago
#2
To buy on the twelfth day of the year I would use 2 conditions, MonthOfYear = 1 and DayOfMonth >= 12
0
Best Answer
u33m2ha8
 ( 0.00% )
- ago
#3
Thank you.

I don't really understand what you wrote here: "When setting up the variable for optimization, you need to define logical minimum, maximum, and step values ​​to avoid the nonsense you're seeing." Could you show me a building block to achieve these settings?

Or are there building blocks in Wealth Lab like "Count of Trades for Period," "Signal only once per Bar/Period," or "Once per Year"?

Thanks in advance.
0
Glitch8
 ( 10.87% )
- ago
#4
>>I don't really understand what you wrote here: "When setting up the variable for optimization, you need to define logical minimum, maximum, and step values ​​to avoid the nonsense you're seeing." Could you show me a building block to achieve these settings?<<

I just mean you need to set up a range of values that makes sense for the indicator you are optimizing. See the screen shot below for an example.

>>Or are there building blocks in Wealth Lab like "Count of Trades for Period," "Signal only once per Bar/Period," or "Once per Year"?<<

No. Blocks can't cover everything, and there are two ways to approach this. One would be to create the Strategy in C# code which doesn't have the same limitations. The second would be to commission us to make some custom Building Blocks for you using our Concierge Development service. This could also fall under one of the higher tiers of my Patreon which includes some time for custom development work.
0
Glitch8
 ( 10.87% )
- ago
#5
1
u33m2ha8
 ( 0.00% )
- ago
#6
Thats Day of Month, not Day of Year
0
Glitch8
 ( 10.87% )
- ago
#7
Correct. I was just using it as an example of how to set optimization value ranges 🙄
0
u33m2ha8
 ( 0.00% )
- ago
#8
Thank you
0
- ago
#9
QUOTE:
One would be to create the Strategy in C# code

Since it looks like you want to steer away from standard WL behavior frequently, I would either plan to implement your strategies in C# or get a local partner to C# code your special needs. It's more fun with a partner. And the WL framework will let you create your own custom C# class libraries you can call from your strategies. I use my own C# class libraries to call external packages (e.g. Math.NET) for statistics, polynomial curve fitting, and XY plotting. Extensibility is the power behind the WL framework!

The Blocks approach is good for simple and typical trading needs, but for custom/special needs, using C# is much more flexible.
0

Reply

Bookmark

Sort