Adding cheating to any strategy
Author: EJoub
Creation Date: 6/24/2013 3:12 PM
profile picture

EJoub

#1
I want my strategy to look at the next day's prices during a backtest for educational purposes. This should show perfect trades because the code looked at the next day's prices before it traded. I know this can't give alerts. I would appreciate assistance.

.
profile picture

Eugene

#2
Check this out:

1. WealthScript Programming Guide > Programming Trading Strategies > Peeking
2. Wiki > The Dangers of Looking Ahead in Trading System Development
profile picture

EJoub

#3
Thanks, I can't wait to have a look.
profile picture

EJoub

#4
Like this...without the +1 ? It works well.

CODE:
Please log in to see this code.

profile picture

Cone

#5
Translate this code for a better shot at "perfection". (But I really had hoped the idea of doing this would never come up again.)
profile picture

EJoub

#6
Hi Cone/Eugene
I have this code of Koch but that is not what I had in mind. My crystal ball is not that accurate.
Thanks in any case. Try my code and look at the chart.
If you are interested in my thinking please send me an e-mail or I can send you one.
profile picture

Cone

#7
I'd be interested to argue why it's an exercise in futility here on the forum.
profile picture

EJoub

#8
Of course I owe the forum for all the assistance in the past. Please I don't need an argument only assistance.

1000000000 traders have done this exercise before me but I haven’t...thus educational. Maybe you can remember that I was trading Mutual funds with delayed prices.

The code I have requested was only to see the overall results of trading correctly, long only. It is easy to see from the graphs alone how one should trade if you knew what a market is going to do without any code.

I’m doing statistical analysis on buying and selling the next day on either the correct low or high at either open or close. Long only. Thus “correct” is my definition of perfect in this case. Therefore I have reduced the variables as follows. I know whether I’m buying or selling and I know it will be on the open or close but not which one of the two (buying low is obvious) . If it gaps up after a drawback it is easy. The key is underlined. I also know that only a reasonable % positive differences will lead to profits. I also know that the market swings high and low during the day before it closes. This can be a problem and sometimes beneficial. I can also see very good profits if a reasonable % (50% or more) of trades are profitable and if not, I can sell quickly.

It may be futile to do the statistics as you say. I’m sure that you have a strategy that is close to my description... please share and save me from doing the statistics. I’m using EOD for testing but I’m also live on the market for actual trading. And I don’t run out of equity during the day.

Your comments will also be very useful as usual and please explain why I’m flirting with the “futile”. And this is only WIP at the moment.
I know most of above stuf is extremely basic and obvious.
profile picture

LenMoz

#9
EJoub, please don't waste the time of busy people on exercises that serve no useful purpose. Thank you.
profile picture

EJoub

#10
Ok, then I'm on my own. You are probably an old hand and can see that my exercises are stupid but I'm not an old hand.

QUOTE:
If you are interested in my thinking please send me an e-mail or I can send you one


I tried not to put this on the forum because I was afraid of a respons like yours. But Cone came along and he could not know what I was going to write.

If you are part of the WL team and you represent them then please accept my humble appology for wasting your time.

Maybe you have a good argument against my innocent incompotence and can steer me away from disaster and suggest a way
out of this mess. You may even have statistics on above...I have not completed mine yet.

I thank you for your advice.
profile picture

LenMoz

#11
I am not part of the WL team. I am only a WL user since February and a Sandbox Author on WealthSignals. On the forum or off the forum, answering questions takes time of the WL team, I have at least three forum posts awaiting responses, some since May, from that same team.

Unless I misunderstand, your premise is that you know tomorrow's prices, which of course, can never be true. So no useful conclusion follows.

Thank you,
Len
profile picture

EJoub

#12
Hi Len, I just requested the peeking code and never said that I’m going to trade it. And obviously we do not know exactly what is going to happen in the future but we know/assume some things about the future otherwise our strategies are a waste of time.

Backtesting is peeking to the past and using it to find an edge in the future. We even test out of sample data or randomise data to find an edge (positive probability/ expectancy) and peeking/ projecting/ predicting into the future with our strategies. And we do it with real money.

Like many other traders I have limited my choice for the very next day to two possibilities...one of them will be correct. See my post above.

Ok, I suppose I have added nothing new unless a newbie reads this.

I agree with preserving time but Cone became interested. I owe him very much.

profile picture

LenMoz

#13
The goal of a strategy is to maximize future gain. When developing, you need to measure how good it is. I measure using strategy's performance vs. buy-and-hold or vs. S&P 500. Those are already built into WL. I find no reason to measure against perfect trading.
profile picture

EJoub

#14
There are 100 ways to view performance on WL. B&H and a market index are not required at all.

I never said I’m using perfect trading as a measure of performance or for trading.

This topic is about my request for a cheeting code and further than that I have no more comments.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).