Optimization: Same underlying, different time ?  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Optimization: Same underlying, different time ?

Postby joebone » 25 Mar 2019

In portfolio trader I can use one strategy to trade multiple underlyings and optimize for one setting over all these underlyings.

Is there a regular way or is there a hack to be able to optimize for one strategy over several different time segments on the same underlying.

Say I have a strategy that does well in High volatility. I want to optimize for those times and not the times with low volatility.

So could i run an optimization that ran for 10,000 bars in 2008 and 10,000 bars in late 2015-Jan 2016? To find the best settings for those times while ignoring the times in between?

I could just write some code that doesn't take a trade in non optimal times but that would limit me to optimizing by Net Equity and I want to optimize by sharpe ratio.

So this is kind of like a simultaneous walk forward. Does this make sense?

Thanks

User avatar
Anna MultiCharts
Posts: 560
Joined: 14 Jul 2017
Has thanked: 42 times
Been thanked: 140 times

Re: Optimization: Same underlying, different time ?

Postby Anna MultiCharts » 26 Mar 2019

Hello, joebone!

I’m afraid this cannot be done within one workspace. You need to create separate portfolio workspaces, each with different data ranges to be able to optimize the desired time periods.

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: Optimization: Same underlying, different time ?

Postby joebone » 26 Mar 2019

Hello, joebone!

I’m afraid this cannot be done within one workspace. You need to create separate portfolio workspaces, each with different data ranges to be able to optimize the desired time periods.
thanks for reply Anna,

Could I save price data as a custom symbol and align the date and bar time to all be the same? I've never tried to save custom symbols?

Zheka
Posts: 224
Joined: 13 Jan 2016
Has thanked: 8 times
Been thanked: 53 times

Re: Optimization: Same underlying, different time ?

Postby Zheka » 28 Mar 2019

Hi joebone,

it is not really clear what you want to achieve...and why skipping certain periods - either in a 'hard-coded' way or by defining 'high vol' periods dynamically - hurts your ability to optimize by a metric you want?

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: Optimization: Same underlying, different time ?

Postby joebone » 28 Mar 2019

Hi joebone,

it is not really clear what you want to achieve...and why skipping certain periods - either in a 'hard-coded' way or by defining 'high vol' periods dynamically - hurts your ability to optimize by a metric you want?

Zheka, thanks for reply.

I was afraid it wasn't clear.

Let me first try again on the main objective.

I am using a simple on / off switch to activate the signal. ( N bars slope of a dummy Net Equity function to track the algos performance. ) If the equity line is sufficiently sloped upward then the algo gets traded.

I have several algos that switch on/off. I want to tune them for specific conditions in the market. This will hopefully prepare me for many different market types and keep the algos from competing with each other for the same alpha. So my current method is to train the algo for high volatility then just cycle through possible genetic optimization solution on out of sample data to see which ones did well. Then select the those.

I think a better solution would be to have the algo train on multiple data series at the same time like portfolio trader can do. I would then be able to identify and run several thousand bars during segments that met my conditions. I believe this will lead to a more robust solution.

I want to optimize for highest sharp ratio performance. If I understand correctly wouldn't having long flat periods of no trades cause this ratio to skew in an undesirable way? A way that may not get me an optimal sharp ratio use? This is why I want to be able to select certain times of the same underlying to train on simultaneously.

hopefully this is a more clear explanation.

Thanks

Zheka
Posts: 224
Joined: 13 Jan 2016
Has thanked: 8 times
Been thanked: 53 times

Re: Optimization: Same underlying, different time ?

Postby Zheka » 28 Mar 2019

It is clearer :-)

You have access to all the trades, so calculate 'Sharp ratio' based on trades, not on 'calendar periods'.
It will be the more adequate measure for your purposes.

User avatar
joebone
Posts: 175
Joined: 05 Sep 2018
Has thanked: 53 times
Been thanked: 4 times

Re: Optimization: Same underlying, different time ?  [SOLVED]

Postby joebone » 29 Mar 2019

It is clearer :-)

You have access to all the trades, so calculate 'Sharp ratio' based on trades, not on 'calendar periods'.
It will be the more adequate measure for your purposes.
Yeah.. i did a poor job explaining the first time.


Return to “MultiCharts”