Mean Return and Mean Return Period

Would like to see future (n) returns be an option for signals or fitness value.

For instance, if you have a SMA 10/20 cross over signal, calculate future returns in say 4 days, that is a fitness value
then if you had a SMA 20/100 cross over signal, calculate future returns in say 4 days and do the same. The one with the higher results has the best returns.

Attachments
No attachments
  • Votes +2
  • Project StrategyQuant X
  • Type Feature
  • Status Archived
  • Priority Normal
  • Assignee None
  • Milestone Archived (To be done later)

History

c
#1

Charles

22.03.2019 21:42

Task created

KL
#2

kainc301

22.03.2019 22:16
Can you be more specific? How would this differ from seeing the profit from each trade? Are you talking about not using profit targets and closing trades after a certain amount of time after a signal? Im trying to understand the difference between what you consider a future return and a regular trade.
c
#3

Charles

22.03.2019 23:46
Profit from a trade is closed when either take profit or stop loss is hit.


Future returns at period n (say 5 hours, 10 days, 50 days etc) will specifically look at the return from the signal n periods out in the future. These returns would need to be averaged together to get a mean future return and that's the factor I'm looking for. 


Why is this important, a signal may hit it's profit target or stop loss but depending on take profit or stop loss.. that doesn't tell you if the signal had any value.  But if you averaged future returns from a period you could see if the signal actually had any predictive power.

KL
#4

kainc301

23.03.2019 00:47
Starting to get a sense of what you're saying. Still lost on how to apply the calculation. Say you have 1000 trades, are you measuring the period n from each trade? I guess what I'm trying to get at is if  you're looking at a period from one signal to measure the return from other signals in the same time frame, how would you prevent the calculation from doing the same thing on the very next signal that is within your period n? Are you saying 1000 trades would have 1000 n periods to measure, giving you 1000 different averages to work with? 


I submitted alpha as a calculation to help determine if a given signal is predictive for this reason because I believe it is a much better calculation for what you are trying to achieve. See if you concur https://www.youtube.com/watch?v=acCZy9MqEWw


If you have a formula to help derive the value you're looking for and it is different than this, please post it. Averaging returns over a given period of time does not provide as much context as to where to specifically measure each interval of time. I'm sure if you've seen this somewhere there is a more detailed formula for it. That is what is needed for this to be coded. Otherwise, your averages might not reflect the values you're looking for. 


c
#5

Charles

23.03.2019 01:32
I think your youtube video on the alpha calculation would be good also!!!!


But you are correct in saying that if there are 1000 trades, there would be 1000 future returns at period n (again this could be any time in the future measured in minutes, hours, days etc). If you average those returns (mean) then you get an idea of what future returns might look like for that signal.  


So any time the signal occurs, it looks in the future n, gets the returns at that period, and adds it to all previous future returns from that signal.


If I had to express in math or pseudo code, I would say:


global futureReturns 

global numSignals 

If a signal has occurred 

   get future return at period n

   add that future return to futureReturns

   numSignals = numSignals + 1

end if 


at end of simulation

  mean future return =   futureReturns / numSignals 



KL
#6

kainc301

23.03.2019 01:43
Okay cool. I'm assuming the time period n would be user defined. Have you used this calculation before? If so what seems to be a range for n that gives a significant result? From what I'm understanding if n was something like 5 minutes, the calculation should be useless as it is unlikely for many strategies to have another signal within that timeframe (unless scalping) so it would appear n would have to be a larger value for general use cases. Is there a default value that you've seen used for this type of calculation so there is a baseline to work with in order to make sure its calculated correctly?
c
#7

Charles

23.03.2019 02:02
Well, I don't think the specific time in the future matters. I.e. the next signal does not have to generate within the same timeframe...... and we are just trying to see what the mean future returns look like at period n.


For instance, say I want to search for strategies on a  15 minute chart that are profitable 1 hour later. Well if instead of using profit factor or something like that... I could just have the fitness function be the mean future returns in 60 minutes from whenever the signal was generated.   We are just trying to find out of a signal or searches find strategies that have predictive power in the future. The time is up to the user how long they want to look out.


So say I'm on the daily chart.... and want to search for strategies who's signal has positive mean future returns if long 20 days later ( one month,  5 days per week x 4)  and negative mean future returns if I am short 20 days later.


Once there was a database of strategies who have high fitness in the 1 month future returns, then we could play around with stop loss and take profit... but we know overall it's likely profitable in the future.


Does that make sense?

KL
#8

kainc301

23.03.2019 05:57
Yes actually. That is a much clearer explanation. I definitely think it is a good idea to implement now that I understand it more
c
#9

Charles

23.03.2019 23:43
Thank you for looking into implementing this, think this is a great addition.  


Let me know if you have any other questions.


Also I think the alpha idea you mentioned is worth doing as well. 


Thanks Again Keinc301

c
#10

Charles

24.03.2019 02:38
Voted for this task.
KL
#11

kainc301

24.03.2019 12:01
Do you have any suggestion for an official name for this? My original confusion came from describing this as the future return as this can be interpreted differently if the underlying calculation isnt obvious. I tried researching to see if this measurement was named this somewhere and I couldn't find any relating documentation.
c
#12

Charles

27.03.2019 03:08
Depends on how you develop it I guess. If it is used just as a fitness function then I think "Future Return Period" or something like that could work. In the docs it would just have to say that it is a multiple of the current timeframe. So if we were currently using hours, and we set Future Return Period to be 24, it would get the mean future returns 24 hours after the signal was generated.
KL
#13

kainc301

27.03.2019 12:14

Subject changed from Future Returns to Mean Return and Mean Return Period

The using 'future' could be misleading as to the functionality of this feature so I took the liberty of renaming this the mean return as this is what you are looking for.

After taking the time to think about how useful this could be, I am in full agreement that it should be incorporated. 


Mean return would be a value that can be used for custom fitness and the mean return period would calculate the mean return value over that period of time from all signals placed. In otherwords, its not looking at the results of the trade itself (when the take profit or stop is hit), its just measuring if price moved in our favor within a certain amount of time from the signal. 


Since this has to gather new stats on trades after a certain time period that passes, I recommend adding the stats of this feature to the list of trades so we can we can see the measurement of profit made or lost x time after we entered the trade.

KL
#14

kainc301

27.03.2019 12:15
Voted for this task.
KL
#15

kainc301

27.03.2019 13:31
I would also recommend the period is calculated from the time after a signal has occurred and not from a number of bars as this should be a feature available for signals taken on non-time based charts such as renkos/range bars etc.
c
#16

Charles

28.03.2019 01:16
Those are all great points. I think you have it spot on!!! Thank you Keinc301, this will be a great added feature that get's away from stop loss/take profit for initial strategy discovery and can let us know if there is any profitable signal from a found strategy.
KL
#17

kainc301

28.03.2019 20:47
When this is addressed, it should use the same logic as https://sq.projectpanel.com/tasks/sqp_0004 for measuring the time after a trade happened in order to measure the statistic. However, here the mean return would not close the actual trade. It would just measure the Net Profit up to the point it would close at the end of n amount of time.
MF
#18

Mark Fric

16.02.2020 13:52

Status changed from New to Archived


Votes: +2

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please