To automate or not to automate?

If you don't know where to start, start here! Don't be afraid to ask questions.

Moderator: moderators

Aldo
rank: <50 posts
rank: <50 posts
Posts: 18
Joined: Sun Feb 10, 2008 11:13 am
Reputation: 0
Gender: None specified

Postby Aldo » Sat Mar 29, 2008 9:53 am

Good info again guys, much appreciated. The secret society analogy is completely understandable, being a successful modern day alchemist is an aspirational job :)

The hardest way to make an easy living. lol

Allan

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

greaterreturn
rank: 50+ posts
rank: 50+ posts
Posts: 64
Joined: Mon Feb 11, 2008 2:57 am
Reputation: 0
Gender: None specified

Postby greaterreturn » Mon Mar 31, 2008 4:21 pm

Some more on the conversation about NinjaTrade and NeoTicker. I have them both. I developed strategies and indicators in both.

There's three major differentiating categories that matter in my comparison.

1. Simplicity of writing indicators & strategies. NinjaTrader is many times easier to write scripts if you're already familiar with C#. It has a very intuitive, mostly object oriented API. NeoTicker on the other hand requires you to manage memory yourself and has a obtuse interface rather than a natural and elegant object oriented one.

2. Ability to use tick data. NinjaTrader falls down in this category. It reloads the entire data every time you change your script and shockingly, it completely reloads all the data on every iteration of an optimization. That of course makes it painfully slow unless you're only using 1 or 2 days of tick data. Yuck. Neoticker is slightly better. But as Michal did, I may have to write my own optimizer.

NOTE: NinjaTrader tech support says they are working on optimizing the handling of tick data to make all this fast and all processing of long term tick data in NT version 7. If that pull this off well, it will be an awesome system.

3. Tech support. NinjaTrader wins hands down. They answer posts in the forum within minutes usually. And almost that fast even on weekends and evening. They must pay reps to cover the forums around 16 hours 7 days away, it appears. Awesome. NeoTicker has a couple of customers who answer posts nearly that fast, but if they don't know the answer, it can take a while.

I'm going to limp along with NinjaTrader since my strategy requires very little optimization until I get it into production. Then I'll be forced to write my own optimizer.

Sincerely,
Wayne

User avatar
eudamonia
rank: 500+ posts
rank: 500+ posts
Posts: 536
Joined: Thu Jun 15, 2006 9:50 pm
Reputation: 0
Location: Rocklin, CA
Real name: Edward Heming
Gender: Male
Contact:

Postby eudamonia » Mon Mar 31, 2008 5:21 pm

Wayne,

Thanks for the comparison, it's great to hear from someone who is using NinjaTrader the way you are.

I personally love NinjaTrader and NeoTicker both but for different reasons.

I'm glad you are finding what works for you.

Edward
Eudaimonia (pron.: you-die-moan-e-a) (Greek: εὐδαιμονία) is a classical Greek word commonly translated as 'happiness'. The less subjective "human flourishing" is often preferred as a translation.

greaterreturn
rank: 50+ posts
rank: 50+ posts
Posts: 64
Joined: Mon Feb 11, 2008 2:57 am
Reputation: 0
Gender: None specified

Postby greaterreturn » Mon Mar 31, 2008 6:35 pm

Yes. I love this forum for several items I learned here that weren't so clear anywhere else.

1. Avoid harming squiggly lines. :D a.k.a. study price action rather than lagging indicators. (Thanks TRO)
2. Focus on probability and statistics.
3. Analysis of the ideal times to trade Forex. (thanks Michal!)
4. Proper and improper use of back testing, value of forward testing!
5. Trading highs, lows, middle of previous hour bars and dynamic SR. (Thanks, TRO!)
6. Monte Carlo runs and risk analysis. (thanks Edward).

To any newbies, make sure you learn all these things in these forums if you haven't already.

Sincerely,
Wayne

greaterreturn
rank: 50+ posts
rank: 50+ posts
Posts: 64
Joined: Mon Feb 11, 2008 2:57 am
Reputation: 0
Gender: None specified

Ideas on automated Market Conditions

Postby greaterreturn » Sat Apr 05, 2008 2:42 pm

Edward, Michal, TRO and any other experienced traders...

Several posts in this thread refer to the importance of "market conditions" and I agree. So far the only 1 that I found effective is tick volume with daily draw down limits somewhat helpful.

There's a new thread to discuss daily filters of strategies. It uses my automated strategy in NinjaTrader to frame the discussion. But it should apply similarly to discretionary.

Daily Market Conditions for Auto Trading

Please critique. It'll be helpful for everyone on the forum because many threads have posts with members asking about filtering trades.

If you provide ideas that produce results on my strategy, I want to reward you--either a financial token of my appreciation via Paypal, some other service or if you want the full details on this strategy.

Sincerely,
Wayne

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

peter_77_peter
rank: <50 posts
rank: <50 posts
Posts: 41
Joined: Fri Feb 02, 2007 3:36 pm
Reputation: 0
Location: a beautiful pirate island in the mediteranean sea
Gender: Male

Sharing some experiences achieved by 1,5 years of hard work!

Postby peter_77_peter » Sun Apr 06, 2008 12:58 pm

Dear pirates,

though this seems to be the most frequented thread in sharing experiences about automated trading, I´d like to post some learnings, simply to document that I agree to everybody saying that you have to do your homework cleverly and thoroughly. There is no free lunch and no way to bypass hard and thoughtfull work.

Well, after about one and a half year of development, the prototype of our trendfollowing automated strategy is about to get online soon. I think we did our homework and came up with a system that is basically based on:

- Multi Time Frame TrendFilter Matrix, each filter based on carefully chosen PMSMs of well thought out signals, relatively measured, without absolute thresholds. (more to that in the text below)

- Triggers for the local timeframe, based on carefully chosen PMSMs of well thought out signals, relatively measured, logically circuited cleverly. (more to that in the text below)

- A bunch of Exit Strategies basically setting up a volatility channel, that moves along with the price and protectively narrows, when events occur like change in signals, change in profitability. Everything relative again, and adaptive to the market. Additional protection for some other sources of risk.

- Position Sizing that is based on the Exit Strategies and dynamically adjusted to risk measures and volatility when a trade is on.

- StockPicking throughout hundreds of diverse markets, finally putting together a portfolio of our best performing stocks using EquityStops for every strategy.

Alltogether its a bunch of strategies, some thousands of Lines of Logic / TS Code plus some homegrown globalvariable.dll for communication between the strategies, and visualizing the most interesting intern variables to get everything of importance displayed easily on a Multi-Data Screen for each Stock.

It was very nice to see how the robustness of the approach got better and better with the implementation of each logic module we´ve added. We´ve read a lot of books and articles, wrote our own documentation of about 60 Pages, because we agree to "You MUST know what you´re doing", and think, that if you know the dependencies of your straetegies´ settings, and the limitations of TS optimization, then optimization is still a good possibility to get a "proof of concept" for the individual aspects of your trading system.

Some of the concepts we use are inspired by TROs PMSM approach, some are inspired by Chuck Lebeaus Work on Exits, some are inspired by Alex Elders Work, the Books of Jack Schwager and Michael Covel have been helpful as well, some articles by van tharp cosidering sizing are quite helpful, etc. pp. we´ve rethought all this approaches, trying to customize them for our needs and add our own touch to it, because we agree in everything has to fit your trading style. Besides that we´ve come up with a lot of own ideas, derived from watching stocks and signals historically and live for some zillion hours, formulating our own ideas first, and testing them carefully.

Actually none of the above mentioned books or articles in forums will reveal any secrets, neither do I with this post. But alltogether the reliable advice you pick up here and there will finally add up to some kind of framework/guidance helping you setting up a do list and specify all sources of failure and problems you´ll have to solve on your own.

To those who believe in "the worlds best indicator": Basically, the only Input to trust is PRICE, and, everybody who tries to invent a "crystal ball" must fail. There will be thousands of people who want to sell you systems, books or advice. Trust nobody, get inspired by the work of traders that do real trading (you´ll get a gut feeling in this in the quality of advice they give), and then: do your homework, create your own approach.

In Trendfollowing you will never get in perfect and you will never get out perfect, but if you´re doing good, then you will still be able to slice out a rewarding piece from the midth. There´s nothing to predicition, everything is about well thought out reactions to price. Setting up a consistent automated trading system is all about rational thinking of what can happen, thinking about the different ways of how to react and choose one before you´ll face it in reality, basically, developing a trading system is: the attempt to learn how to trade, if you succeed you´ll found your personal edge, if not, you have to try again.
There is a nice quotation of Samuel Becket that somehow resembles the endurance it takes to succeed in developing a trading system:
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better.

Keep in mind: Trend Following is only one of many approaches. In the end all approaches can be probably categorized by a number you´ll be able to count with ten fingers. Choose the approach that seems to resemble your preferences best first and then concentrate on creating your own instance of this approach, developing your personal edge. Remind yourself about beeing consistent with this approach, that is there will be no "one size fits all trading system working in every market under every condition", that is i.e. the entry setups, exit strategies, and overall goals chosen, should match with the outline/scope/limitations of the approach.

If I say the only Input is price, then there´s still some room for squeezing out all information from price, i.e. direction, strength, momentum, trendiness, volatility. There´s not much more information than that available, so it´s better to concentrate on how to build up a reasonable logical circuit from the available Information. I really like using TROs PMSM approach for almost everything, because, if you´ll adapt it the way you need it, it will force you to think how to convert squiggly lines into discrete signals and this is what you need as Input for the "logical circuits" you have to build resembling the setups you want to trade, so it´s basically a good receipt to avoid fitting, throughout clever thinking.

It´s rewarding to think about every possible aspect of your trading system, like the tradeoff of the averages you use smoothing your signals, the tradeoff of acquiring informations from different timeframes, or the tradeoff incorporated with the measurement of profitability you put on, ... , in the end you cannot eliminate risk, you only want to learn how to control risk systematically, so you have to be aware of every source of risk and every possible leak, where risk might enter your approach. Or, put the other way round, you`ll probably won´t be creating your edge from doing something scientifically completely new that nobody has ever done before, but, by carefully rethinking common sense best practice and finding your own style and discovering small rooms for improvements in each and every step you do and step by step.

And remember, this is no exact business, you won´t find a perfect setting, every decision you´ll take is a tradeoff: For every advantage you´ll make you have to pay something. Like: When you want to get less noise, you´ll have to pay in terms of lag.

It seems true to me that: Exits and the Risk and Sizing Calculations derived from that are most crucial. You might want to review the posts in the thread "Exit Strategies-Whatis your prefered way for exiting trades?" to evaluate some possibilities.

It´s all about staying in the market, and that is all about being able to face loosing streaks. If you adjust your sizing to that, you´ll survive almost any drawdown and, finally stay long enough in the market to cash in the positive expectancy you get from the careful design of your entry and exits strategies.

There is no free lunch, the profit you get from the market is the reward to the risk you´re taking. You won´t be able to get great returns without taking the related risk. Any risk you take will occur somewhen, are you able to face it? So in the end you have to adjust the risk you take to the levels you´re able to face and should concentrate your efforts on: trying to cash in the reward you should get from that effectively, basically this is all you can ask from the market. The best tool to earn a living from taking moderate risk is: Beeing smart and patient, and besides that: Accumulation over time, if you follow an antimartingale point of view, you might be able to grow your equity geometrically. But remember the prerequisite: you have to survive in the markets to be able to do that.

Choosing the time frame is about the tradeoff: noise in data vs. increase in possibilities to trade. Using daily data is coming up with less noise then, lets say using 15Minutes data. On the other hand side using daily data, you won´t get the trading activity you need to achieve reliable data, revising the results from your developoment. If you choose "faster timeframes" you´ll produce more trading, incorporating some more risk through noise as well as higher cost of trading, that is a crucial trap as well, so find your tradeoff.

We´re starting with conservative risk parameters (i.e. 1-1.5% per trade) and conservative time frames (matched with the information we get from even more conservative timeframes). We measure the resulting average trade in terms of days and not minutes. We´re in the market about 40-60% of time, depending on stock profile and strategy settings. If we´ll achieve our goals with the conservative setup, we might adjust to faster time frames and more aggressive settings. But remember that you start as a bloody beginner, and if you "want too much, too fast", you´ll basically increase the possibility of beeing swept out from the markets, before you get any reward. Do you really want to risk all the effort you´ve put in your development by simply beeing greedy or impatient without any necessity?

You won´t be able to trade any stock with your system but have to find a profile of stocks that fit to your style of trading. We´ve choosen a trend following approach, and our overall goal is "linearity of equitycurves" and robustness.

The so far achieved robustness, revised in testing is quite promising, about 15% of all stock´s we´ve tested matched well with the profile we need for our strategy, like trendiness, volatility, liquidity, price level. In the some dozens of Stocks that ended up in the final peer group, we´ve chosen to have a closer look, we were able to achieve the main overall goals with the exact same parameter setting of our strategies. If we then adapt the strategy settings to the individual stocks, we see that each parameter is quite robust in itself, that is, we see plateaus, not mountains. We don´t look for the parameters that get us the best absolute return, we look for robust settings, and good relative performance figures that resemble our concepts. We´re quite happy that we seem to be robust to out of sample data, that is, shifting the period/start/end/date of our testing window and watching the results, can be interpreted as a reasonable mapping from the stock data, transforming it undergoing the logic of our system, resulting in a final equity curve that seems to resemble the properties we´ve aimed for developing the logic our system.

The next step we have to perform is Monte Carlo Analysis, to get a better esteem about the risks/drawdowns we´re facing, finally adjusting our risk/sizing parameters to that. The thing you have to keep in mind concerning this is: If you generate some hundreds of trades with your backtesting, parameters like %winners might be reliable, but the distribution of trades is not reliable. But the distribution of the trades is crucial to the appearance of loosing streaks, drawdowns and in the end your ability to stay in the market as well as the overall performance. Adjusting your risk parameters to that is crucial for staying in the market. So if you´ll adjust your risk parameters to backtesting, the chances that you´re doing fitting are high. That´s why you have to run monte carlo analysis to get a better esteem on a proper choice of risk / sizing. So if anybody knows a good tool for doing this, any link or suggestion is highly appreciated. Some pirate discussion about Monte Carlo can be reviewed in the thread "Daily Market Conditions for Auto Trading".

We´ve used TS for development, because, adding our globalvar.dlls we could achieve our basic needs and prototype everything easily. If everything works out, we will recode everything, probably using NT, because TS is a stupid interpreter that is somehow medieval and definitely has its limitations.

Everything works out means, that we´ll be going live with a portfolio of some Stocks, automatically traded by our systems, getting a "real money real world" track record, because in the end, this is the only reliable data. If we achieve a overall performance of 10-15% in the first year we can be happy to continue, trying to improve our approach adding more diversity in markets, timeframes, strategies, permutations, as well as incorporating the learnings derived from our "real money, real world" results, markets change a lot, you have to continually adapt to that, that is, you have to learn/improve every day, or you´ll be swept out. If we fail to reach our goals, then we´ll be reviewing all results and then evaluate whether to accept failure, or investing some more time/money.

So, I agree to everybody who says that building a trading systems is like any other job: First and foremost it´s a lot of hard work, with a lot of ups and downs, and you´ll be getting close to "pack everything and dump it" a lot of times. But, finally if you´re doing your homework, being crystalclear in your thoughts, carefully revising every step you take, not giving up on this long journey, and never get attempted by greed or any other emotional sources of failure, then you might be rewarded in the end.

You definitely have to be passionate about doing all this, otherwise you´ll won´t make it!

All stimulating input/feedback highly appreciated, thanks and good luck to everybody,

best from spain,
peter

User avatar
michal.kreslik
rank: 1000+ posts
rank: 1000+ posts
Posts: 1047
Joined: Sat May 13, 2006 2:40 am
Reputation: 36
Location: Monte Carlo, Monaco
Real name: Michal Kreslik
Gender: Male

Postby michal.kreslik » Sun Apr 13, 2008 2:12 pm

Hello, Peter,

in the field of automated trading, I'd say I can usually tell the author who knows what is he talking about from the one who doesn't in the first three sentences of his article. Then I stop reading if it's the latter case.

I've read your post in one shot. It shows that you've really done your hard homework and you're heading towards becoming one of the 0.01% of the people who make it as automated traders. I can put my signature to almost everything that you said in your post. Thanks for being a kreslik.com member and posting your thoughts here.

peter_77_peter wrote:the distribution of trades is not reliable. But the distribution of the trades is crucial to the appearance of loosing streaks


You are probably talking about the time/sequence distribution of the trades, not about the trade outcome distribution itself. Sure, the particular sequence of trades' outcomes in testing (and in trading as well) is random. Otherwise you could only open the trades that you know will be profitable. Obviously, that would be too easy.

With multiple degrees of freedom as your trading system inputs, the best approach is to use some non-black-box AI algorithm like GA. GA cuts on the optimization time considerably and if set up properly, it's not generally prone to converging towards local maxima on the fitness landscape. You already know that the fitness function should be closely related to the linearity of the equity curve, measured with no position sizing. Under certain circumstances, the fitness function should be constructed in a different way, but that would be a topic on its own.

You don't need to use Monte Carlo random sampling for determining your risk/position sizing values. It's actually much simpler than that. You just need to ask yourself two questions:
  • what is the maximum loss in terms of the trading capital percentage before I stop trading this system?
  • what I want the probability of such a loss be?
You can determine both of these values at your discretion and risk appetite based on the results of your testing. I'm sure you know how to calculate it.

I wish you all success!
Michal

User avatar
eudamonia
rank: 500+ posts
rank: 500+ posts
Posts: 536
Joined: Thu Jun 15, 2006 9:50 pm
Reputation: 0
Location: Rocklin, CA
Real name: Edward Heming
Gender: Male
Contact:

Postby eudamonia » Mon Apr 14, 2008 8:41 pm

Peter,

Ditto to what Michal said. Thanks for sharing your hard earned experiences and I wish you success in your endeavors.

Edward
Eudaimonia (pron.: you-die-moan-e-a) (Greek: εὐδαιμονία) is a classical Greek word commonly translated as 'happiness'. The less subjective "human flourishing" is often preferred as a translation.

greaterreturn
rank: 50+ posts
rank: 50+ posts
Posts: 64
Joined: Mon Feb 11, 2008 2:57 am
Reputation: 0
Gender: None specified

Postby greaterreturn » Tue Apr 15, 2008 12:44 am

Michal and others are right about the challenges. Right now I'm dealing with the Windows Server blocking a port to MB Trading. Neither side can figure out why yet. The other issue I have to resolve is that NinjaTrader has a simplistic model for filtering bad ticks.

I see an example of a burst of over 100 "out of band" ticks all within 300 milliseconds and then prices return to the correct level.

But those prices don't appear on the minute data for eSignal--only the tick data. So they clearly corrected it after the fact in the minute data but didn't bother to fix the tick data.

Ninjatrader's built-in tick filter assumes that after the 3rd out of bounds tick they're legitimate.

Again, like Michal said, just setting up the infrastructure is a lot of work. Taking many hours.

Wayne

User avatar
michal.kreslik
rank: 1000+ posts
rank: 1000+ posts
Posts: 1047
Joined: Sat May 13, 2006 2:40 am
Reputation: 36
Location: Monte Carlo, Monaco
Real name: Michal Kreslik
Gender: Male

Postby michal.kreslik » Tue Apr 15, 2008 12:49 am

greaterreturn wrote:Ninjatrader's built-in tick filter assumes that after the 3rd out of bounds tick they're legitimate.

Never rely on anything else than just your own code for filtering.

greaterreturn wrote:just setting up the infrastructure is a lot of work. Taking many hours

If not months :)

Michal

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “beginners forum”