Meta strategy for position management (size, #positions etc)

All posts which do not fit into any other sections of the forum.

Moderator: admin

Meta strategy for position management (size, #positions etc)

Postby Exolon » Thu Sep 10, 2020 5:13 pm

Hi,

I've been doing some optimisation and backtesting with various strategies and noticed that each of them contains slightly different parameters for managing things like:

  • position size: some only allow selection of 1-10,000 "lots". Others, e.g. the "Ultimate Oscillator" seem to allow selection of position size as a percentage of total equity or usable margin, which I find preferable to a constant value. Maybe minimum/maximum position size parameters could be added, to reduce the risk of miscalculation there.
  • whether trades can be opened in buy/sell/both directions
  • limits to the number of open trades in either or both directions.

These seem like very useful features that would apply to almost all strategies, so it would be a pity to have to re-implement them each time.

Would it be possible to create a meta-strategy that takes these parameters and also takes any other underlying strategy (which will have its own specific parameters, of course)? This would be a way to re-use the position management logic via composition, dynamically.

If something like this already exists, then apologies for the noise!
Exolon
 
Posts: 31
Joined: Thu Jul 07, 2011 5:39 pm
Location: Ireland


Re: Meta strategy for position management (size, #positions

Postby Exolon » Fri Sep 11, 2020 7:43 am

Well, there are probably many useful strategies that have are missing the clever position management features that exist in other strategies. It'd be a shame if you had to duplicate that functionality into every strategy.

Since installing an indicator adds custom functions so strategies can use them, perhaps we could put some of that common code into a dummy indicator or strategy, which could then be called by other strategies to get that functionality without duplicating it every time?

I might try it out on the weekend -- will share it here if I can get something working :)
Exolon
 
Posts: 31
Joined: Thu Jul 07, 2011 5:39 pm
Location: Ireland

Re: Meta strategy for position management (size, #positions

Postby Apprentice » Tue Oct 06, 2020 7:57 am

As a rule, you can NOT call strategy from other strategies directly.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Meta strategy for position management (size, #positions

Postby Exolon » Mon Nov 02, 2020 8:40 pm

Apprentice wrote:As a rule, you can NOT call strategy from other strategies directly.

Thanks for the clarification. My plan was to make an indicator that does nothing except expose some utility functions, but I didn't get far enough to test it -- I'm guessing it won't work, either.
That's a pity -- it would be nice to have some mechanism for code re-use between strategies, since some of them are missing features or have inconsistent behaviour.
Exolon
 
Posts: 31
Joined: Thu Jul 07, 2011 5:39 pm
Location: Ireland


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 9 guests