NexusFi: Find Your Edge


Home Menu

 





Auto trading is only thing that conquered my darkside


Discussion in Psychology and Money Management

Updated
      Top Posters
    1. looks_one liquidcci with 71 posts (65 thanks)
    2. looks_two monpere with 54 posts (53 thanks)
    3. looks_3 sidney7g with 45 posts (1 thanks)
    4. looks_4 Xeno with 33 posts (11 thanks)
      Best Posters
    1. looks_one RM99 with 1.1 thanks per post
    2. looks_two monpere with 1 thanks per post
    3. looks_3 liquidcci with 0.9 thanks per post
    4. looks_4 Xeno with 0.3 thanks per post
    1. trending_up 73,236 views
    2. thumb_up 208 thanks given
    3. group 35 followers
    1. forum 358 posts
    2. attach_file 16 attachments




 
Search this Thread

Auto trading is only thing that conquered my darkside

  #331 (permalink)
andyb1979
London UK
 
Posts: 37 since Aug 2011
Thanks Given: 7
Thanks Received: 4

Good advice.

I found the options in Openquant (thanks google) to add commissions and slippage. I added $3/side for FX (Interactive brokers) and 0.0001 slippage. That's a mere pip. I'm thinking to simulate bid/ask and slippage I should be going more in the region of 5 pips.

Here's the updated curve with the same parameters. Ok great exercise - now I can work on the "real" problem not the fake problem. Lol

FYI Lightspeed broker offers extremely high speed and low commissions. I'm thinking to use them in the end not IB.

Attached Thumbnails
Click image for larger version

Name:	EURUSD Forward Test 4.png
Views:	281
Size:	56.8 KB
ID:	47575  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Futures True Range Report
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #332 (permalink)
 
Silver Dragon's Avatar
 Silver Dragon 
Cincinnati Ohio
Legendary Master Data Manipulator
 
Experience: Intermediate
Platform: TastyWorks / NT
Broker: TastyWorks /NT
Trading: FX, Stocks, Options
Posts: 2,107 since Feb 2011
Thanks Given: 6,422
Thanks Received: 5,238

You might try MB Trading for Forex. 2.95 per 100,000. Plus you get discounts when using limit orders on their ECN. My average commission when trading 10,000 lot is less than .40 cents round trip with their setup.



andyb1979 View Post
Good advice.

I found the options in Openquant (thanks google) to add commissions and slippage. I added $3/side for FX (Interactive brokers) and 0.0001 slippage. That's a mere pip. I'm thinking to simulate bid/ask and slippage I should be going more in the region of 5 pips.

Here's the updated curve with the same parameters. Ok great exercise - now I can work on the "real" problem not the fake problem. Lol

FYI Lightspeed broker offers extremely high speed and low commissions. I'm thinking to use them in the end not IB.


nosce te ipsum

You make your own opportunities in life.
Visit my NexusFi Trade Journal Reply With Quote
  #333 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,397 since Jun 2009
Thanks Given: 33,173
Thanks Received: 101,537



Xeno View Post
That's exactly what I'm thinking. To be honest, if you see a decent equity curve, you usually find there's a problem with something, hence my questions.

First thing I thought of which doesn't seem to have been brought up yet, was the "test" time frame. If the in-sample data is 2007-2010, and the out of sample data is 2010-2011, my question is - have you made any changes to this strategy since testing it on 2010-2011 data? Because once you do, then it is no longer out of sample data, but in sample data...

For example, first time you run the backtest, 2010-2011 looks bad. Hours later you emerge with tweaks, and now 2010-2011 looks good. That is the same as testing 2007-2011 all at once, and highly curve fitted.

As others have mentioned, you need to account for slippage (a market order is 'slippage' right there) and commissions. If you are taking any trades around news events, that could be a major problem too.

Last, I noticed you are using 15m bars. I don't know what you are using to backtest, I am not familiar with it. But most likely, if like some other platforms, then testing on such a big bar for such small profit targets will result in very unreliable results, due to the lack of OHLC ordering (did the H come first, or the L). If your software supports a per-trade report, look to see how many trades reach their profit target on 1 bar. Now go back and count all those as losers, not winners, and see how it looks.

Naturally you can learn these things from trading live as well. That's how I did.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #334 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704

I'll try to be diplomatic.

1) I use a $25/contract/roundtrip commission and slippage as a baseline and I don't even look twice at a strategy that doesn't yield at least 5 ticks/trade above and beyond that. Low net profit/trade systems tend to be all hat and no cattle. They get absolutely monkey stomped when going live.

2) A strategy that yields $70k over 4 years COULD be worth the risk if it truly yielded that much. My experience is that if a strategy (when backtested) yields $X, you can cut that in half to get an idea of how much it will actually yield live. That's because backtesting cannot escape at least some degree of curve fitting/opmiziation. You should do a serious robustness evaluation to determine just how optimized your system is. If you alter the setting even slightly and the strategy loses SIGNIFICANT profits, then be wary. If you alter the settings and the strategy goes negative (unless you absolutely, intentionally try to sabotage it) then run the other way.

You should always compare the anticipated return with your buy and hold alternative. What was the risk free rate of return over the last 4 years? Is the risk of trading a system worth it compared to what you could have made if you simply invested in the market at large? I've told some of my friends that tried to dabble in trading, that sometimes you'd be better off just spending the money, that way at least you know you'll get some satisfaction out of it.

3) As Mike informed you, any strategy that can complete an entire (entry/exit) cycle within a single bar increment on your chart is inherently biased.

In essence....keep working. You'll get there, but if you ever get that feeling you've developed the printing press, the Golden Goose or the money tree, come back to futures.io (formerly BMT) for some grounding

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
Thanked by:
  #335 (permalink)
 Xeno 
UK
 
Experience: Intermediate
Platform: Ninja
Broker: Mirus/Zen
Trading: Futures - bonds, currencies, index
Posts: 288 since Oct 2010
Thanks Given: 70
Thanks Received: 274

Lot of good advice coming in here from people who have been there.

In my backtesting career, I have had about four occassions where a very good equity curve and stats jumped out at me early in the testing process. On 100% of those occassions there was an error in the strategy or backtesting process. By the fourth time it happened, there was no excitement. I knew immediately what the likely explanation was. I'm afraid that's the sort of sceptical mindset you have to have.

Your good looking equity curve was a very good example of how one of the stats can look great but it's pointless getting excited until you've ticked the boxes that need to be ticked.

In anticipation of someone asking what those ticks are, here are mine

1. Enough trades for significant stats
2. Distribution of optimised parameters is robust (This is done before the test really. This is what RM99 meant when saying you should be able to tweak parameters without profit plunging)
3. avge per trade is way more than commission + typical slippage
4. Equity curve is regular
5. Drawdown acceptable in amount and duration for account size.
6. Sanity check on trades, esp big winners and losers and ones that last one bar
7. Trade data is out of sample
8. Testing period includes different market types appropriate for strategy (e.g. period is not just a bull market) - another way of looking at that is that there is a reasonably even split between long and short profits

There are others, which I go into in more detail afterwards, but that's my starting eight. It's tempting to get excited if a few of those look good, but I could develop a strategy in 15 mins that had great figures for a few of them.

Reply With Quote
Thanked by:
  #336 (permalink)
andyb1979
London UK
 
Posts: 37 since Aug 2011
Thanks Given: 7
Thanks Received: 4

Hi guys,

Wow, sage advice, Yes I get the impression I just learned a potentially hard lesson, the easy way. I also think that since this is a non-linear problem perhaps I need to up the ante slightly and attack it in a non-linear way. So far I'm using indicator combinations and a little money management and I think it shows that it may work for some time, but not all the time. Or it may work in a canned market but in the real world? ...

re some points raised, some comments;



Quoting 
For example, first time you run the backtest, 2010-2011 looks bad. Hours later you emerge with tweaks, and now 2010-2011 looks good. That is the same as testing 2007-2011 all at once, and highly curve fitted.

Yes - in the cases I was considering out of sample always looked good (ie: positive) before further optimisation, however adding commissions and now 5 pips slippage (realistic on EURUSD) my portfolio takes a bath. Back to the drawing board. Its something to be aware of though.

Just out of interest, how do you backtest properly consider once you've looked at out of sample data once, then you risk curve fitting if you tweak? I was planning to paper trade a full 6 months on an algorithm that retrained regularly, say every week.


Quoting 
You should always compare the anticipated return with your buy and hold alternative. What was the risk free rate of return over the last 4 years? Is the risk of trading a system worth it compared to what you could have made if you simply invested in the market at large? I've told some of my friends that tried to dabble in trading, that sometimes you'd be better off just spending the money, that way at least you know you'll get some satisfaction out of it.

This is a good point and precisely what financial institutions do when they estimate the volatility adjusted returns (Sharpe ratio) using the Risk Free rate (typically 10 year Gilts or Treasuries) as a basis. Also I was considering trying an alternative which is random buys/sells ie: a random walk trader. If my system can't beat random them its rubbish.

Regarding "risk free" investment, currently 100% of my money is invested in a Nationwide super saver account paying 3%. LOL. There it will stay until I am confident I have a system or preferably systems that are worth taking the risk over.


Quoting 
1. Enough trades for significant stats
2. Distribution of optimised parameters is robust (This is done before the test really. This is what RM99 meant when saying you should be able to tweak parameters without profit plunging)
3. avge per trade is way more than commission + typical slippage
4. Equity curve is regular
5. Drawdown acceptable in amount and duration for account size.
6. Sanity check on trades, esp big winners and losers and ones that last one bar
7. Trade data is out of sample
8. Testing period includes different market types appropriate for strategy (e.g. period is not just a bull market) - another way of looking at that is that there is a reasonably even split between long and short profits

Excellent list thanks. Re-runing the optimiser with commissoins and slippage I found the optimiser cleverly optimised out all the trades (aka the losses being commissions) leaving me with an optimum condition of "No trades". Very good

So, Openquant doesnt let you write your own fitness function but there is a workaround. I'm planning to use System Quality Number(SQN) which includes some weighting given to trading opportunities.

Ave per trade > commission + slippage definitely. I need to reduce trading and increase the profit target.

4, 5, 6, 7, 8 . Yes good ideas

-----

So, I feel a little dissapointed, out of my 3 strategies I'd developed in R 2 now lose my shirt and the third scrapes a living off the EURO or GBP but not worth the risk IMO.

Backing out to a daily chart its a different story and my systems are still profitable but not as good as they were (certainly more volatile). I think maybe it would be wise to drop back to the daily scale where theres more signal less noise as I get to grips with these concepts. There are plenty of opportunities to be made on Stock indices, Fx pairs and major commodities just with simple rules based strategies. A system that trades once a month may be boring yes, but we're not doing this for excitement right?

For shorter timescales I need a non-linear system. I have loads of ideas just when to implement them??!

Thanks again guys and keep up the feedback, I'm listening

Reply With Quote
  #337 (permalink)
andyb1979
London UK
 
Posts: 37 since Aug 2011
Thanks Given: 7
Thanks Received: 4

Ok, I took a step back and applied a trend following strategy I've developed on the daily EURUSD only. Forget 15 mins for now, its too noisy. I need to go back to basics and back to the daily chart.

So this strategy is simple, it buys dips in an uptrend using SMA as a trend indicator (Gradient of SMA = trend) and a fast oscillator for entry. Now the secret sauce was this. I added in a take-profit target to close 50% of the position and a stoploss (initially placed below the recent low, moved to breakeven after take-profit was hit). I ran this through the optimiser. Now I didn't optimise ANY parameters of indicators - just the profit target. Once the profit target is hit, it then runs a trailing stop on the remaining 50%.

The result - profitable! This is with commissions and 5 pips slippage. I changed all orders to limit orders (stop, entry, take profit, trailing). Stops are updated daily (on bar close).

Now this is the best bit. I ran the same strategy over a basket of stocks without any re-optimisation and its profitable on every single one. Ok some more volatile returns than others but not bad at all. Now I'm thinking its too good to be true (heh)

Next up.

- My trailing stop implementation is a simple %. I want to use an ATR stop (e.g. the SuperTrend) to maximise profit
- More testing. Try to break it bad - higher slippage, higher commissions
- More sanity checking. Simulate on wider basket of stocks/instruments
- Paper trading on live

I'll keep you updated

Attached Thumbnails
Click image for larger version

Name:	trendfollowing stats.png
Views:	300
Size:	105.6 KB
ID:	47673  
Reply With Quote
Thanked by:
  #338 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704


andyb1979 View Post
Ok, I took a step back and applied a trend following strategy I've developed on the daily EURUSD only. Forget 15 mins for now, its too noisy. I need to go back to basics and back to the daily chart.

So this strategy is simple, it buys dips in an uptrend using SMA as a trend indicator (Gradient of SMA = trend) and a fast oscillator for entry. Now the secret sauce was this. I added in a take-profit target to close 50% of the position and a stoploss (initially placed below the recent low, moved to breakeven after take-profit was hit). I ran this through the optimiser. Now I didn't optimise ANY parameters of indicators - just the profit target. Once the profit target is hit, it then runs a trailing stop on the remaining 50%.

The result - profitable! This is with commissions and 5 pips slippage. I changed all orders to limit orders (stop, entry, take profit, trailing). Stops are updated daily (on bar close).

Now this is the best bit. I ran the same strategy over a basket of stocks without any re-optimisation and its profitable on every single one. Ok some more volatile returns than others but not bad at all. Now I'm thinking its too good to be true (heh)

Next up.

- My trailing stop implementation is a simple %. I want to use an ATR stop (e.g. the SuperTrend) to maximise profit
- More testing. Try to break it bad - higher slippage, higher commissions
- More sanity checking. Simulate on wider basket of stocks/instruments
- Paper trading on live

I'll keep you updated

You are getting it.

You can optimize profit taking and exit management with much less curve fitting effect than if you try to optimize the entries.

There are thousands of tricks/methods for optimizing and managing the trade exit.

Breakeven points. Scale out points. Scale in points. Simple trailing stops. Custom trailing stops (that only activate at certain levels and adjust, like parabolics and shrinking stops).

By trying combinations of exits, you'll find that systems that were marginal can become viable.

When I optimize I tend to leave the entry signals alone. I don't touch them. I simply try to see how much money I can squeeze out of the entries I do have.

This way, there's still curve fitting involved...but usually, your live trading extracts some fraction of the optimized result, but it's usually a very good chance that it will be profitable. (i.e. the optimized results might have been $10k, and in reality you were able to only capture $7k). The live results will almost always be some number less than the "optimal solution."

This is another way of saying "let your winners run and cut your losers short." A winning trade will be a winning trade, it's just a matter of how much.

Also, be very wary of optimizing your stop loss amounts. You can actually curve fit to the point that a slight adjustment means huge swings in profitability, so do a robustness check and leave yourself room to breathe. Just because your optimization says that the optimal stop amount is 31 ticks, doesn't mean that's the best choice.

What happens is that the optimizer recognizes that there was a single trade that drew down 30 ticks and then recovered for a nice large (sometimes out of tolerance) winner. In essence, had your stop been 30 ticks, it would have been a huge swing, cause it would have been a loser instead of a winner (and a big winner at that).

In the end, I try to leave stops and entry signals fairly static and use a combination of profit exits and trails to wring out as much profit as a system will allow.

The next step is discovering that all systems and their efficiency are dependent upon the entry. But I find it's much easier and expeditious to start by optimizing and focusing on exits....when you REALLY get good is when you can find a significant and consistent edge

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
Thanked by:
  #339 (permalink)
andyb1979
London UK
 
Posts: 37 since Aug 2011
Thanks Given: 7
Thanks Received: 4

Thanks!

Ok good so its not impossible then (to create a working trading strategy). Yes from speaking to several traders I have been told to take a percentage of profit early and move a stop to break even. Only when I implemented this in software and simulated it did I see how powerful it actually is.

re: Optimisation and curve fitting, I get it. I feel more confident that I did not touch the entry rules, just exit, that this has a chance of working live. Also I plan when I optimise to output the optimisation parameters to a chart and look for clusters of optimum parameters. Ie: To make sure I didn't just get lucky with a stop of XYZ.

Still working to replace the % trailing for a supertrend / ATR based trailing stop. Its hard to implement but I have a feeling going to be worth it!

Reply With Quote
  #340 (permalink)
 RM99 
Austin, TX
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
Posts: 839 since Mar 2011
Thanks Given: 124
Thanks Received: 704



andyb1979 View Post
Thanks!

Ok good so its not impossible then (to create a working trading strategy). Yes from speaking to several traders I have been told to take a percentage of profit early and move a stop to break even. Only when I implemented this in software and simulated it did I see how powerful it actually is.

re: Optimisation and curve fitting, I get it. I feel more confident that I did not touch the entry rules, just exit, that this has a chance of working live. Also I plan when I optimise to output the optimisation parameters to a chart and look for clusters of optimum parameters. Ie: To make sure I didn't just get lucky with a stop of XYZ.

Still working to replace the % trailing for a supertrend / ATR based trailing stop. Its hard to implement but I have a feeling going to be worth it!

Some programs will actually do a robustness analysis for you. But essentially, that's what you're manually doing by picking settings that are resistant to large swings in performance.

At some point, when I get sophisticated enough, I'm going to develop multi dimensional mapping that will show "heat maps" of where particular nodes of high performance ocurr. These maps allow you to visually select plateau areas and avoid very narrow spikes (where the performance falls off sharply with small adjustment). Basically, it's a robustness check in visual form.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote




Last Updated on January 17, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts